Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(doc): add jest specific pckg command #13607

Merged
merged 8 commits into from
Aug 3, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,24 @@ $ TEST_ONLY=babel-cli make test
$ TEST_ONLY=babel-plugin-transform-classes make test
```

Or you can use Jest:
tony-go marked this conversation as resolved.
Show resolved Hide resolved

```sh
yarn jest babel-cli
tony-go marked this conversation as resolved.
Show resolved Hide resolved
```

Use the `TEST_GREP` variable to run a subset of tests by name:

```sh
$ TEST_GREP=transformation make test
```

Or you can use Jest:
tony-go marked this conversation as resolved.
Show resolved Hide resolved

```sh
yarn jest -t transformation
tony-go marked this conversation as resolved.
Show resolved Hide resolved
```

Substitute spaces for hyphens and forward slashes when targeting specific test names:

```sh
Expand All @@ -140,6 +152,12 @@ To enable the Node.js debugger added in v6.3.0, set the `TEST_DEBUG` environment
$ TEST_DEBUG=true make test
```

Or you can use Node

```sh
yarn node --inspect-brk node_modules/jest/bin/jest.js --runInBand
```
tony-go marked this conversation as resolved.
Show resolved Hide resolved

You can combine `TEST_DEBUG` with `TEST_GREP` or `TEST_ONLY` to debug a subset of tests. If you plan to stay long in the debugger (which you'll likely do!), you may increase the test timeout by editing [test/testSetupFile.js](https://github.com/babel/babel/blob/main/test/testSetupFile.js).

To overwrite any test fixtures when fixing a bug or anything, add the env variable `OVERWRITE=true`
Expand Down