Projektstart

This commit is contained in:
2026-01-22 15:49:12 +01:00
parent 7212eb6f7a
commit 57e5f652f8
10637 changed files with 2598792 additions and 64 deletions

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()
})
})