Skip to content

Commit da84c54

Browse files
chore: add test-watch script to the wrangler workspace
Watch the files in the wrangler workspace, and run the tests when anything changes: ```sh > npm run test-watch -w wrangler ``` This will also run all the tests in a single process (rather than in parallel shards) and will increase the test-timeout to 50 seconds, which is helpful when debugging.
1 parent 8144508 commit da84c54

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.changeset/young-horses-jam.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
chore: add test-watch script to the wrangler workspace
6+
7+
Watch the files in the wrangler workspace, and run the tests when anything changes:
8+
9+
```sh
10+
> npm run test-watch -w wrangler
11+
```
12+
13+
This will also run all the tests in a single process (rather than in parallel shards) and will increase the test-timeout to 50 seconds, which is helpful when debugging.

CONTRIBUTING.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ Tests in a workspace are executed, by [Jest](https://jestjs.io/), which is confi
135135
```
136136
- Watch the files in a specific workspace (e.g. wrangler), and run the tests when anything changes
137137
```sh
138-
> npm run test -w wrangler -- --watch
138+
> npm run test-watch -w wrangler
139139
```
140+
This will also run all the tests in a single process (rather than in parallel shards) and will increase the test-timeout to 50 seconds, which is helpful when debugging.
140141

141142
## Steps For Making Changes
142143

packages/wrangler/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@
9797
"bundle": "node -r esbuild-register scripts/bundle.ts",
9898
"build": "npm run clean && npm run bundle",
9999
"start": "npm run bundle && NODE_OPTIONS=--enable-source-maps ./bin/wrangler.js",
100-
"test": "CF_API_TOKEN=some-api-token CF_ACCOUNT_ID=some-account-id jest --silent=false --verbose=true"
100+
"test": "CF_API_TOKEN=some-api-token CF_ACCOUNT_ID=some-account-id jest --silent=false --verbose=true",
101+
"test-watch": "npm run test -- --runInBand --testTimeout=50000 --watch"
101102
},
102103
"engines": {
103104
"node": ">=16.7.0"

0 commit comments

Comments
 (0)