Files
memecoin-botV2/.pnpm-store/v10/files/4e/d7bfd96b1b57aa66e812474e2638b57a1236ed7afefea8afe28da5fc23f74383dc9db8b13dc0f05b56a6208071da98a6e75049a3344ae5411b75d40cb87df6

35 lines
803 B
Plaintext

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