18 lines
632 B
JavaScript
18 lines
632 B
JavaScript
import { describe, expect, it } from 'vitest';
|
|
import { createApp } from '../src/server/app.js';
|
|
|
|
describe('static assets', () => {
|
|
it('serves the push service worker as JavaScript instead of the app shell', async () => {
|
|
const app = createApp();
|
|
|
|
const response = await app.request('/push-sw.js');
|
|
const body = await response.text();
|
|
|
|
expect(response.status).toBe(200);
|
|
expect(response.headers.get('content-type')).toContain('javascript');
|
|
expect(body).toContain("self.addEventListener('push'");
|
|
expect(body).toContain('showNotification');
|
|
expect(body).not.toContain('<div id="root">');
|
|
});
|
|
});
|