Aktueller Stand

This commit is contained in:
2026-01-22 19:05:45 +01:00
parent 85dee61a4d
commit e280e4eadb
1967 changed files with 397327 additions and 74093 deletions

View File

@@ -1,11 +1,14 @@
'use strict'
const test = require('tap').test
const { test } = require('node:test')
const { createWarning } = require('../')
const { withResolvers } = require('./promise')
test('emit should set the emitted state', t => {
t.plan(3)
const { promise, resolve } = withResolvers()
process.on('warning', onWarning)
function onWarning () {
t.fail('should not be called')
@@ -16,15 +19,17 @@ test('emit should set the emitted state', t => {
code: 'CODE',
message: 'Hello world'
})
t.notOk(warn.emitted)
t.assert.ok(!warn.emitted)
warn.emitted = true
t.ok(warn.emitted)
t.assert.ok(warn.emitted)
warn()
t.ok(warn.emitted)
t.assert.ok(warn.emitted)
setImmediate(() => {
process.removeListener('warning', onWarning)
t.end()
resolve()
})
return promise
})