Skip to content

Commit 916d1b6

Browse files
rajasegartylerturdenpants
authored andcommitted
[DOCS] Update debugging workflow in README (#232)
Fixes #231
1 parent da28041 commit 916d1b6

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ const params = a.value.params.map(p => {
177177
### 2. Inspect the process with node debug
178178
179179
Here we are going to start the tests selectively in node debug mode. Since the
180-
codemod is bootstrapped using [codemod-cli](https://github.com/rwjblue/codemod-cli) which is using [jest](https://jestjs.io/) in turn
180+
codemod is using [jest](https://jestjs.io/) in turn
181181
to run the tests, jest is having an option `-t <name-of-spec>` to run a particular
182182
set of tests instead of running the whole test suite.
183183
@@ -186,14 +186,24 @@ For more details on node debug, visit the [official](https://nodejs.org/en/docs/
186186
Node.js debugging guide, and for jest documentation on tests, please refer [here](https://jestjs.io/docs/en/cli).
187187
188188
```sh
189-
node --inspect-brk ./node_modules/.bin/codemod-cli -t '<fixture-name>'
189+
node --inspect-brk ./node_modules/.bin/jest --runInBand --testNamePattern <test-name>
190190
```
191191
192-
For example, if you want to debug the `null-subexp.input.hbs` fixture or only that particular test case is failing
193-
because of an issue.
192+
For example, if you want to debug the `null-subexp` test or only that particular test case is failing because of an issue.
194193
195194
```sh
196-
node --inspect-brk ./node_modules/.bin/codemod-cli -t 'null-subexp'
195+
node --inspect-brk ./node_modules/.bin/jest --runInBand --testNamePattern 'null-subexp'
196+
```
197+
198+
Or you can make use of the npm scripts defined in package.json. All you need to pass the test name as the extra parameter with the script.
199+
200+
```sh
201+
npm run debug:test 'null-subexp'
202+
```
203+
204+
Using yarn
205+
```sh
206+
yarn debug:test 'null-subexp'
197207
```
198208
199209
Once you run the above command, your tests will start running in debug mode and your breakpoints will be

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"scripts": {
2323
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
2424
"debug:integration": "node --inspect-brk ./test/run-test.js",
25+
"debug:test": "node --inspect-brk ./node_modules/.bin/jest -i -t ",
2526
"deploy": "npm version patch && git push && git push --tags && npm publish",
2627
"lint": "eslint . --cache",
2728
"test:integration": "node ./test/run-test.js",

0 commit comments

Comments
 (0)