-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove
zone-patch
and its fallback (#1427)
BREAKING CHANGE Since Angular 11, the minimum version of `zone.js` is 0.11.x and Angular 10 is EOL so now we can use zone patch directly from `zone.js`. If one is not using `zone.js@0.11.x`, please upgrade.
- Loading branch information
Showing
3 changed files
with
5 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,11 @@ | ||
require('../utils/reflect-metadata'); | ||
|
||
try { | ||
// If the user are using zone.js 0.11.1+ | ||
// all jest support logic are implemented inside zone.js | ||
// we only need to load zone-testing module | ||
!process.execArgv.includes('--experimental-vm-modules') | ||
? require('zone.js/bundles/zone-testing-bundle.umd.js') | ||
: require('zone.js/fesm2015/zone-testing-bundle.min.js'); | ||
} catch (err) { | ||
// Fallback logic to load zone and zone-patch | ||
// when the user still use zone.js 0.10.x | ||
require('zone.js/dist/zone'); | ||
require('zone.js/dist/proxy'); | ||
require('zone.js/dist/sync-test'); | ||
require('zone.js/dist/async-test'); | ||
require('zone.js/dist/fake-async-test'); | ||
require('../zone-patch'); | ||
} | ||
!process.execArgv.includes('--experimental-vm-modules') | ||
? require('zone.js/bundles/zone-testing-bundle.umd.js') | ||
: require('zone.js/fesm2015/zone-testing-bundle.min.js'); | ||
|
||
const getTestBed = require('@angular/core/testing').getTestBed; | ||
const BrowserDynamicTestingModule = require('@angular/platform-browser-dynamic/testing').BrowserDynamicTestingModule; | ||
const platformBrowserDynamicTesting = require('@angular/platform-browser-dynamic/testing') | ||
.platformBrowserDynamicTesting; | ||
const { BrowserDynamicTestingModule } = require('@angular/platform-browser-dynamic/testing'); | ||
const { platformBrowserDynamicTesting } = require('@angular/platform-browser-dynamic/testing') | ||
|
||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.