Skip to content

Commit d101adc

Browse files
committed
Simplify the test script
1 parent 5d2d374 commit d101adc

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

.github/workflows/ci.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
with:
2222
node-version: ${{matrix.node}}.x
2323
- run: yarn install
24+
- run: yarn build:all
2425
- run: yarn test
2526

2627
lint:

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
"loop": "yarn workspaces foreach -Apti --include \"@datadog/*\" --exclude \"@datadog/build-plugins\"",
2828
"oss": "yarn cli oss -d packages -l mit",
2929
"publish:all": "yarn loop --no-private npm publish",
30-
"test": "yarn build:all && yarn workspace @dd/tests test",
31-
"test:noisy": "yarn workspace @dd/tests test:noisy",
30+
"test": "yarn workspace @dd/tests test",
3231
"typecheck:all": "yarn workspaces foreach -Apti run typecheck",
3332
"version:all": "yarn loop version --deferred ${0} && yarn version apply --all",
3433
"watch:all": "yarn loop run watch"

packages/tests/README.md

+4-13
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Especially useful for having mock projects, built with specific bundlers and run
1111

1212
<!-- #toc -->
1313
- [Run all the tests](#run-all-the-tests)
14-
- [Run all the tests with all the logs](#run-all-the-tests-with-all-the-logs)
1514
- [Debug a test](#debug-a-test)
1615
- [Test a plugin](#test-a-plugin)
1716
- [Bootstrapping your test](#bootstrapping-your-test)
@@ -26,22 +25,14 @@ Especially useful for having mock projects, built with specific bundlers and run
2625
yarn test
2726
```
2827

29-
## Run all the tests with all the logs
30-
31-
By default, jest is in silent mode and won't show any logs.
32-
33-
```bash
34-
yarn test:noisy
35-
```
36-
3728
## Debug a test
3829

3930
You can target a single file the same as if you were using Jest's CLI.
4031

4132
Within your test you can then use `.only` or `.skip` to target a single test in particular.
4233

4334
```bash
44-
yarn test:noisy packages/tests/...
35+
yarn test packages/tests/...
4536
```
4637

4738
## Test a plugin
@@ -98,19 +89,19 @@ During development, you may want to target a specific bundler, to reduce noise f
9889
For this, you can use the `--bundlers=<name>,<name>` flag when running your tests:
9990

10091
```bash
101-
yarn test:noisy packages/tests/... --bundlers=webpack4,esbuild
92+
yarn test packages/tests/... --bundlers=webpack4,esbuild
10293
```
10394

10495
If you want to keep the built files for debugging purpose, you can use the `--cleanup=0` parameter:
10596

10697
```bash
107-
yarn test:noisy packages/tests/... --cleanup=0
98+
yarn test packages/tests/... --cleanup=0
10899
```
109100

110101
If you want to also build the bundlers you're targeting, you can use the `--build=1` parameter:
111102

112103
```bash
113-
yarn test:noisy packages/tests/... --build=1
104+
yarn test packages/tests/... --build=1
114105
```
115106

116107
### More complex projects

packages/tests/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"scripts": {
2121
"build": "yarn clean && tsc",
2222
"clean": "rm -rf dist",
23-
"test": "yarn test:noisy --silent",
24-
"test:noisy": "JEST_CONFIG_TRANSPILE_ONLY=true VITE_CJS_IGNORE_WARNING=true NODE_OPTIONS=\"--openssl-legacy-provider --experimental-vm-modules ${NODE_OPTIONS:-}\" jest --verbose",
23+
"test": "JEST_CONFIG_TRANSPILE_ONLY=true VITE_CJS_IGNORE_WARNING=true NODE_OPTIONS=\"--openssl-legacy-provider --experimental-vm-modules ${NODE_OPTIONS:-}\" jest",
2524
"typecheck": "tsc --noEmit"
2625
},
2726
"dependencies": {

0 commit comments

Comments
 (0)