Skip to content

Commit

Permalink
[tests] add a new "test:quick" yarn target
Browse files Browse the repository at this point in the history
This will use the `babel-jest` transformer instead of the `ts-jest` one.
Babel won't perform typescript type checks and this will therefore run
faster.
  • Loading branch information
adimasci authored and adimascio committed Jul 26, 2019
1 parent b240a0a commit e2c15c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ on a change:
yarn test:unit --watchAll
```

`yarn test:unit` executes karma with rollup preprocessors for transpilation and bundling.
Finally, you can deactivate typescript checks to run tests quicker:

```bash
yarn test:quick
```

This can be useful to accelerate your development cycle temporarily when
developing a new feature or fixing a bug. Under the hood, this will use the
`babel-jest` transformer on typescript files instead of `ts-jest`.

### Lints and fixes files

Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
},
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.ts$': 'ts-jest',
'^.+\\.ts$': process.env.VQB_QUICKTEST ? 'babel-jest' : 'ts-jest',
},
transformIgnorePatterns: ['/node_modules/', 'tests/*.js', 'playground/*'],
collectCoverage: true,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"playground": "concurrently \"yarn:build-bundle --watch\" \"node playground/server.js\"",
"storybook": "start-storybook -p 9001 -c .storybook",
"storybook:bundle": "rollup -c .storybook/rollup.config.js",
"test:quick": "VQB_QUICKTEST=1 jest",
"test:unit": "jest",
"tdd": "jest --watchAll"
},
Expand Down

0 comments on commit e2c15c6

Please sign in to comment.