mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
related to https://github.com/angular/angular/pull/47438 After jest 28, `jest-environment-node` and `jest-environment-jsdom` need to be installed by the user themselves, and the API has some breaking changes, so this PR fix these issues to make the zone/jest integration test code work as expected. PR Close #47486
23 lines
514 B
JavaScript
23 lines
514 B
JavaScript
const NodeEnvironment = require('jest-environment-node').default;
|
|
const exportFakeTimersToSandboxGlobal = require('./jest-zone-patch-fake-timer');
|
|
|
|
class ZoneNodeEnvironment extends NodeEnvironment {
|
|
constructor(config, context) {
|
|
super(config, context);
|
|
exportFakeTimersToSandboxGlobal(this);
|
|
}
|
|
|
|
async setup() {
|
|
await super.setup();
|
|
}
|
|
|
|
async teardown() {
|
|
await super.teardown();
|
|
}
|
|
|
|
runScript(script) {
|
|
return super.runScript(script);
|
|
}
|
|
}
|
|
|
|
module.exports = ZoneNodeEnvironment;
|