/
erioxis
/
web-nodejs
Обзор
Документация
Войти
/
erioxis
/
web-nodejs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
backend/node_modules/process-warning/test/jest.test.js
24 строки
585 B
erioxis
lab11fix
15 дек 2025, 23:21
15 дек 2025, 23:21
70dc7ba
Код
Авторство
О чём код?
/* global test, expect */ 'use strict' const { createWarning } = require('..') if (globalThis.test) { test('works with jest', done => { const code = createWarning({ name: 'TestDeprecation', code: 'CODE', message: 'Hello world' }) code('world') // we cannot actually listen to process warning event // because jest messes with it (that's the point of this test) // we can only test it was emitted indirectly // and test no exception is raised setImmediate(() => { expect(code.emitted).toBeTruthy() done() }) }) }