revert revert c74f28caa7

revert one
This commit is contained in:
2025-09-20 13:29:29 +00:00
parent a2271529a8
commit fffd15b241
2539 changed files with 365006 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
'use strict'
const { test } = require('node:test')
const { createWarning } = require('..')
const { withResolvers } = require('./promise')
test('emit with interpolated string', t => {
t.plan(4)
const { promise, resolve } = withResolvers()
process.on('warning', onWarning)
function onWarning (warning) {
t.assert.deepStrictEqual(warning.name, 'TestDeprecation')
t.assert.deepStrictEqual(warning.code, 'CODE')
t.assert.deepStrictEqual(warning.message, 'Hello world')
t.assert.ok(codeWarning.emitted)
}
const codeWarning = createWarning({
name: 'TestDeprecation',
code: 'CODE',
message: 'Hello %s'
})
codeWarning('world')
codeWarning('world')
setImmediate(() => {
process.removeListener('warning', onWarning)
resolve()
})
return promise
})