mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
59aa2c06d1
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
24 lines
519 B
JavaScript
24 lines
519 B
JavaScript
const JSDOMEnvironment = require('jest-environment-jsdom').default;
|
|
const exportFakeTimersToSandboxGlobal = require('./jest-zone-patch-fake-timer');
|
|
|
|
class ZoneJsDOMEnvironment extends JSDOMEnvironment {
|
|
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 = ZoneJsDOMEnvironment;
|