diff --git a/packages/service-worker/test/BUILD.bazel b/packages/service-worker/test/BUILD.bazel index ab1c58812c..16956f533a 100644 --- a/packages/service-worker/test/BUILD.bazel +++ b/packages/service-worker/test/BUILD.bazel @@ -33,14 +33,6 @@ jasmine_node_test( karma_web_test_suite( name = "test_web", - tags = [ - # FIXME: fix on saucelabs - # ERROR: 'There is no timestamp for @angular/service-worker/worker/src/db-cache.js!' - # ERROR: 'There is no timestamp for @angular/service-worker/worker/src/driver.js!' - # ERROR: 'There is no timestamp for @angular/service-worker/worker/src/sha1.js!' - "fixme-saucelabs-ivy", - "fixme-saucelabs-ve", - ], deps = [ ":test_lib", ], diff --git a/packages/service-worker/worker/BUILD.bazel b/packages/service-worker/worker/BUILD.bazel index d520920c87..ac6bc10444 100644 --- a/packages/service-worker/worker/BUILD.bazel +++ b/packages/service-worker/worker/BUILD.bazel @@ -13,14 +13,12 @@ ts_library( "main.ts", ], ), - tsconfig = ":tsconfig.json", deps = ["@npm//@types/node"], ) ts_library( name = "main", srcs = ["main.ts"], - tsconfig = ":tsconfig.json", deps = [":worker"], ) diff --git a/packages/service-worker/worker/testing/scope.ts b/packages/service-worker/worker/testing/scope.ts index 0ae7d384a6..8b1bfb6f2b 100644 --- a/packages/service-worker/worker/testing/scope.ts +++ b/packages/service-worker/worker/testing/scope.ts @@ -100,6 +100,12 @@ export class SwTestHarness implements ServiceWorkerGlobalScope, Adapter, Context return true; } + // If we're in a browser that doesn't support URL at this point, don't go any further + // since browser builds use requirejs which will fail on the `require` call below. + if (typeof window !== 'undefined' && window) { + return false; + } + // In older Node.js versions, the `URL` global does not exist. We can use `url` instead. const url = (typeof require === 'function') && require('url'); return url && (typeof url.parse === 'function') && (typeof url.resolve === 'function'); diff --git a/packages/service-worker/worker/tsconfig.json b/packages/service-worker/worker/tsconfig.json deleted file mode 100644 index f07a5d3baa..0000000000 --- a/packages/service-worker/worker/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "declaration": false, - "strict": true, - "module": "es2015", - "moduleResolution": "node", - "strictNullChecks": true, - "strictPropertyInitialization": true, - "outDir": "../../../dist/all/@angular/service-worker/worker-es2017", - "noImplicitAny": true, - "noFallthroughCasesInSwitch": true, - "rootDir": ".", - "inlineSourceMap": true, - "lib": ["es2015", "dom"], - "target": "es2017", - "typeRoots": [], - "types": [] - }, - "bazelOptions": { - "suppressTsconfigOverrideWarnings": true - }, - "files": [ - "main.ts", - "src/service-worker.d.ts" - ] -}