mirror of
https://github.com/coder/code-server.git
synced 2024-12-26 11:12:07 +03:00
commit
5b5a1f4f97
@ -5,7 +5,7 @@ export async function registerServiceWorker(): Promise<void> {
|
||||
const options = getOptions()
|
||||
logger.level = options.logLevel
|
||||
|
||||
const path = normalize(`${options.csStaticBase}/dist/serviceWorker.js`)
|
||||
const path = normalize(`${options.csStaticBase}/out/browser/serviceWorker.js`)
|
||||
try {
|
||||
await navigator.serviceWorker.register(path, {
|
||||
scope: options.base + "/",
|
||||
|
@ -155,7 +155,7 @@ describe("register", () => {
|
||||
await registerServiceWorker()
|
||||
|
||||
expect(mockFn).toBeCalled()
|
||||
expect(serviceWorkerPath).toMatch(`${csStaticBasePath}/dist/serviceWorker.js`)
|
||||
expect(serviceWorkerPath).toMatch(`${csStaticBasePath}/out/browser/serviceWorker.js`)
|
||||
expect(serviceWorkerScope).toMatch("/")
|
||||
})
|
||||
it("should register when options.base is defined", async () => {
|
||||
@ -176,7 +176,7 @@ describe("register", () => {
|
||||
await registerServiceWorker()
|
||||
|
||||
expect(mockFn).toBeCalled()
|
||||
expect(serviceWorkerPath).toMatch(`/dist/serviceWorker.js`)
|
||||
expect(serviceWorkerPath).toMatch(`/out/browser/serviceWorker.js`)
|
||||
expect(serviceWorkerScope).toMatch("/")
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user