
committed by
Matias Niemelä

parent
7c4afb0da7
commit
ea0e832e5f
@ -15,22 +15,9 @@ import 'zone.js/dist/fake-async-test.js';
|
||||
import 'zone.js/dist/task-tracking.js';
|
||||
import 'reflect-metadata/Reflect';
|
||||
|
||||
// We must first initialize jasmine-core before calling
|
||||
// requiring `zone.js/dist/jasmine-patch.js` which patches
|
||||
// jasmine ENV with code which understands ProxyZone.
|
||||
// jasmine_node_test under Bazel will check if `jasmineCore.boot(jasmineCore)`
|
||||
// has been called and re-use the env if it has.
|
||||
// See https://github.com/bazelbuild/rules_nodejs/pull/539
|
||||
let jasmineCore: any = null;
|
||||
try {
|
||||
// Under Bazel we want to use the jasmine-core version that is
|
||||
// a transive dep of @bazel/typescript. Attempt to require under
|
||||
// its nested node_modules incase it was not hoisted.
|
||||
jasmineCore = require('@bazel/jasmine/node_modules/jasmine-core');
|
||||
} catch (_) {
|
||||
jasmineCore = require('jasmine-core');
|
||||
}
|
||||
jasmineCore.boot(jasmineCore);
|
||||
// Initialize jasmine with @bazel/jasmine boot() function. This will initialize
|
||||
// global.jasmine so that it can be patched by zone.js jasmine-patch.js.
|
||||
require('@bazel/jasmine').boot();
|
||||
import 'zone.js/dist/jasmine-patch.js';
|
||||
|
||||
(global as any).isNode = true;
|
||||
|
Reference in New Issue
Block a user