feat: ServiceWorkerMain.scriptURL (#45863)

feat: serviceWorker.scriptURL
This commit is contained in:
Sam Maddock 2025-03-14 21:00:13 -04:00 committed by GitHub
parent 30d2fadb28
commit afca4e271e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 0 deletions

View file

@ -314,6 +314,17 @@ describe('ServiceWorkerMain module', () => {
});
});
describe("'scriptURL' property", () => {
it('matches the expected value', async () => {
loadWorkerScript();
const serviceWorker = await waitForServiceWorker();
expect(serviceWorker).to.not.be.undefined();
if (!serviceWorker) return;
expect(serviceWorker).to.have.property('scriptURL').that.is.a('string');
expect(serviceWorker.scriptURL).to.equal(`${baseUrl}/sw.js`);
});
});
describe('ipc', () => {
beforeEach(() => {
registerPreload('preload-tests.js');