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

30
node_modules/process-warning/test/emit-set.test.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
'use strict'
const test = require('tap').test
const { createWarning } = require('../')
test('emit should set the emitted state', t => {
t.plan(3)
process.on('warning', onWarning)
function onWarning () {
t.fail('should not be called')
}
const warn = createWarning({
name: 'TestDeprecation',
code: 'CODE',
message: 'Hello world'
})
t.notOk(warn.emitted)
warn.emitted = true
t.ok(warn.emitted)
warn()
t.ok(warn.emitted)
setImmediate(() => {
process.removeListener('warning', onWarning)
t.end()
})
})