Skip to content

Commit

Permalink
Migrate from Mocha to Jest
Browse files Browse the repository at this point in the history
  • Loading branch information
miles170 committed Sep 23, 2022
1 parent ba8124a commit 90f922e
Show file tree
Hide file tree
Showing 19 changed files with 7,375 additions and 4,256 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ types/
/test/restDocs/*.json
/test/restDocs/results/
/test/restDocs/snapshots/
jest*.config.js
3 changes: 0 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@ module.exports = {
sourceType: 'module',
project: './tsconfig.json',
},
env: {
mocha: true,
},
root: true,
};
6 changes: 0 additions & 6 deletions .mocharc.json

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ GAPI_MAX_PARALLEL=3 npm run lint

#### Unit (WIP)

Unit tests for this generator project are written with [Jasmine](https://jasmine.github.io/) and
[Mocha](https://mochajs.org/). They can be run via:
Unit tests for this generator project are written with [Jest](https://jestjs.io/). They can be run via:

```sh
npm run test
Expand Down
10 changes: 10 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.ts$': ['ts-jest', {useESM: true}],
},
testRegex: '(/test/.*|(\\.|/))\\.spec\\.ts$',
};
6 changes: 6 additions & 0 deletions jest.integration.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import config from './jest.config.js';

export default {
...config,
testRegex: '(/test/.*|(\\.|/))\\.integration\\.spec\\.ts$',
};

0 comments on commit 90f922e

Please sign in to comment.