fatsify核心功能示例测试!!!

This commit is contained in:
2025-09-21 14:50:41 +08:00
commit 9145aea047
1958 changed files with 230098 additions and 0 deletions

40
node_modules/process-warning/test/emit-reset.test.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
'use strict'
const { test } = require('node:test')
const { createWarning } = require('../')
const { withResolvers } = require('./promise')
test('a limited warning can be re-set', t => {
t.plan(4)
const { promise, resolve } = withResolvers()
let count = 0
process.on('warning', onWarning)
function onWarning () {
count++
}
const warn = createWarning({
name: 'TestDeprecation',
code: 'CODE',
message: 'Hello world'
})
warn()
t.assert.ok(warn.emitted)
warn()
t.assert.ok(warn.emitted)
warn.emitted = false
warn()
t.assert.ok(warn.emitted)
setImmediate(() => {
t.assert.deepStrictEqual(count, 2)
process.removeListener('warning', onWarning)
resolve()
})
return promise
})