Skip to content

Commit 90f922e

Browse files
committed
Migrate from Mocha to Jest
1 parent ba8124a commit 90f922e

19 files changed

Lines changed: 7375 additions & 4256 deletions

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ types/
44
/test/restDocs/*.json
55
/test/restDocs/results/
66
/test/restDocs/snapshots/
7+
jest*.config.js

.eslintrc.cjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@ module.exports = {
1111
sourceType: 'module',
1212
project: './tsconfig.json',
1313
},
14-
env: {
15-
mocha: true,
16-
},
1714
root: true,
1815
};

.mocharc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ GAPI_MAX_PARALLEL=3 npm run lint
118118
119119
#### Unit (WIP)
120120
121-
Unit tests for this generator project are written with [Jasmine](https://jasmine.github.io/) and
122-
[Mocha](https://mochajs.org/). They can be run via:
121+
Unit tests for this generator project are written with [Jest](https://jestjs.io/). They can be run via:
123122
124123
```sh
125124
npm run test

jest.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default {
2+
extensionsToTreatAsEsm: ['.ts'],
3+
moduleNameMapper: {
4+
'^(\\.{1,2}/.*)\\.js$': '$1',
5+
},
6+
transform: {
7+
'^.+\\.ts$': ['ts-jest', {useESM: true}],
8+
},
9+
testRegex: '(/test/.*|(\\.|/))\\.spec\\.ts$',
10+
};

jest.integration.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import config from './jest.config.js';
2+
3+
export default {
4+
...config,
5+
testRegex: '(/test/.*|(\\.|/))\\.integration\\.spec\\.ts$',
6+
};

0 commit comments

Comments
 (0)