This commit is contained in:
nik
2025-10-03 22:27:28 +03:00
parent 829fad0e17
commit 871cf7e792
16520 changed files with 2967597 additions and 3 deletions

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

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