mirror of
https://github.com/coder/code-server.git
synced 2026-06-07 12:54:31 +00:00
feat(testing): add serviceWorker tests
This commit is contained in:
15
test/patches/service-worker-mock-fetch.patch
Normal file
15
test/patches/service-worker-mock-fetch.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
--- node_modules/service-worker-mock/fetch.js 2021-02-18 13:47:55.000000000 -0700
|
||||
+++ patches/service-worker-mock-fixed.js 2021-02-18 15:49:47.000000000 -0700
|
||||
@@ -1,8 +1,11 @@
|
||||
module.exports = async (request) => {
|
||||
+ const Response = require('./models/Response');
|
||||
const response = new Response('Response from service-worker-mock/fetch.js', {
|
||||
status: 200,
|
||||
statusText: 'ok.'
|
||||
});
|
||||
- response.url = request.url;
|
||||
+ if (request && request.url) {
|
||||
+ response.url = request.url;
|
||||
+ }
|
||||
return response;
|
||||
};
|
||||
Reference in New Issue
Block a user