Commit 89448bc
authored
refactor: Clear jest's cache without validating jest configs (#3312)
This pull request updates the `clean` script in the `package.json` files
across multiple packages to improve how Jest's cache is cleared. The
script now explicitly provides an empty config to the `jest
--clearCache` command, which helps prevent issues if a local or default
Jest config is missing or incompatible.
> [!IMPORTANT]
> It still clears the default cache directory, but! it does not care
about config file validity.[^1]
### Changes
**Script improvements across all packages:**
* Updated the `clean` script in the following `package.json` files to
use `jest --clearCache --config '{}'` instead of just `jest
--clearCache`, ensuring Jest does not look for a config file when
clearing its cache:
- `packages/autocertifier-server/package.json`
- `packages/cdn-location/package.json`
- `packages/cli-tools/package.json`
- `packages/dht/package.json`
- `packages/geoip-location/package.json`
- `packages/node/package.json`
- `packages/proto-rpc/package.json`
- `packages/sdk/package.json`
- `packages/test-utils/package.json`
- `packages/trackerless-network/package.json`
- `packages/utils/package.json`
This also noticeably speeds up the cleanup process.
[^1]: Configs can \*become* invalid due to the processing order of the
`npm run … --workspaces` command – `clean` command of the most "shared"
test package (like `test-utils`) gets called first which may (will) in
the future cause deletion of its jest setup files used by some packages
in their jest setups (like custom matchers).1 parent 91c09c8 commit 89448bc
File tree
11 files changed
+11
-11
lines changed- packages
- autocertifier-server
- cdn-location
- cli-tools
- dht
- geoip-location
- node
- proto-rpc
- sdk
- test-utils
- trackerless-network
- utils
11 files changed
+11
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments