File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"#" : " We must put jest in a sub-directory otherwise VS Code somehow picks up the types and generates conflicts with mocha." ,
3
+ "scripts" : {
4
+ "postinstall" : " ./scripts/patch.sh"
5
+ },
3
6
"devDependencies" : {
4
7
"@types/jest" : " ^26.0.20" ,
5
8
"@types/jsdom" : " ^16.2.6" ,
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ apply_service_worker_mock_patches () {
5
+ # The `service-worker-mock` package is no longer maintained
6
+ # so we have to apply patches ourselves
7
+
8
+ # This patch fixes an undefined error in fetch.js and adds a missing import
9
+ patch --forward node_modules/service-worker-mock/fetch.js < patches/service-worker-mock-fetch.patch
10
+
11
+ # This patch adds a missing import
12
+ patch --forward node_modules/service-worker-mock/models/Response.js < patches/service-worker-mock-response.patch
13
+ }
14
+
15
+ main () {
16
+ echo -e " 🔨 Applying patches..."
17
+ apply_service_worker_mock_patches
18
+
19
+ echo -e " ✅ Patches applied successfully."
20
+ }
21
+
22
+ main " $@ "
You can’t perform that action at this time.
0 commit comments