add offline support
This commit is contained in:
@@ -146,6 +146,17 @@ test('the npm-started local API is exercised through a write-auth proxy on loopb
|
||||
assert.match(indexResponse.headers.get('cache-control') || '', /no-store/);
|
||||
assert.match(indexHtml, /css\/app\.css\?v=0\.12\.14/);
|
||||
|
||||
const { response: manifestResponse, body: manifest } = await requestJson(`${baseUrl}/api/offline-manifest`);
|
||||
assert.match(manifestResponse.headers.get('cache-control') || '', /no-store/);
|
||||
assert.ok(manifest.resources.includes('/offline-worker.js'));
|
||||
assert.ok(manifest.resources.includes('/js/offline-storage.js'));
|
||||
assert.ok(manifest.resources.includes('/js/offline-cache.js'));
|
||||
assert.ok(manifest.resources.includes('/vendor/jquery/jquery-4.0.0.min.js'));
|
||||
const workerResponse = await fetch(`${baseUrl}/offline-worker.js`);
|
||||
assert.equal(workerResponse.status, 200);
|
||||
assert.match(workerResponse.headers.get('content-type') || '', /javascript/);
|
||||
await workerResponse.arrayBuffer();
|
||||
|
||||
const appStyleResponse = await fetch(`${baseUrl}/css/app.css?v=0.12.14`);
|
||||
assert.equal(appStyleResponse.status, 200);
|
||||
assert.match(appStyleResponse.headers.get('cache-control') || '', /no-store/);
|
||||
|
||||
Reference in New Issue
Block a user