/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/harness/patch-node-env.js
24 строки
581 B
hai-x
test: generate snapshots per test case (#20675)
23 мар 2026, 15:19
Не верифицирован
23 мар 2026, 15:19
a475512
Код
Авторство
О чём код?
"use strict"; const NodeEnvironment = // For jest@29 require("jest-environment-node").TestEnvironment || // For jest@27 require("jest-environment-node"); class CustomEnvironment extends NodeEnvironment { constructor(config, context) { // TODO - regression in jest/Node@25.2.0, temporary fix global.localStorage = undefined; super(config, context); } // Workaround for `Symbol('JEST_STATE_SYMBOL')` async handleTestEvent(event, state) { if (!this.global.JEST_STATE_SYMBOL) { this.global.JEST_STATE_SYMBOL = state; } } } module.exports = CustomEnvironment;