/
erioxis
/
web-nodejs
Обзор
Документация
Войти
/
erioxis
/
web-nodejs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
backend/node_modules/process-warning/test/emit-interpolated-string.test.js
34 строки
803 B
erioxis
lab11fix
15 дек 2025, 23:21
15 дек 2025, 23:21
70dc7ba
Код
Авторство
О чём код?
'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 })