build(service-worker): enable karma bazel test for service-worker (#21053)
Corrected the environment detection code which was incorretly throwing exception in the browser if `require` function was found. PR Close #21053
This commit is contained in:
parent
bdee1f4a25
commit
fefc081e1b
|
@ -32,8 +32,6 @@ ts_web_test(
|
|||
bootstrap = [
|
||||
"//:angular_bootstrap_scripts",
|
||||
],
|
||||
# dissable since tests are running but not yet passing
|
||||
tags = ["manual"],
|
||||
# do not sort
|
||||
deps = [
|
||||
"//packages/_testing_init:browser",
|
||||
|
|
|
@ -96,8 +96,7 @@ export class SwTestHarness implements ServiceWorkerGlobalScope, Adapter, Context
|
|||
} as any;
|
||||
|
||||
static envIsSupported(): boolean {
|
||||
return (typeof require === 'function' && typeof require('url')['parse'] === 'function') ||
|
||||
(typeof URL === 'function');
|
||||
return (typeof URL === 'function') || (typeof require === 'function' && typeof require('url')['parse'] === 'function');
|
||||
}
|
||||
|
||||
time: number;
|
||||
|
|
Loading…
Reference in New Issue