Skip to content

Commit 100b033

Browse files
thymikeeSimenB
authored andcommitted
chore: migrate jest-mock to TypeScript (#7847)
1 parent 842f389 commit 100b033

11 files changed

Lines changed: 339 additions & 127 deletions

File tree

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = {
2525
{argsIgnorePattern: '^_'},
2626
],
2727
'import/order': 'error',
28+
'no-dupe-class-members': 'off',
2829
'no-unused-vars': 'off',
2930
},
3031
},

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- `[@jest/types]`: New package to handle shared types ([#7834](https://github.com/facebook/jest/pull/7834))
2424
- `[jest-util]`: Migrate to TypeScript ([#7844](https://github.com/facebook/jest/pull/7844))
2525
- `[jest-watcher]`: Migrate to TypeScript ([#7843](https://github.com/facebook/jest/pull/7843))
26+
- `[jest-mock]`: Migrate to TypeScript ([#7847](https://github.com/facebook/jest/pull/7847))
2627

2728
### Performance
2829

packages/jest-mock/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
"engines": {
1010
"node": ">= 6"
1111
},
12+
"dependencies": {
13+
"@jest/types": "^24.1.0"
14+
},
1215
"license": "MIT",
1316
"main": "build/index.js",
17+
"types": "build/index.d.ts",
1418
"browser": "build-es5/index.js",
1519
"gitHead": "634e5a54f46b2a62d1dc81a170562e6f4e55ad60"
1620
}

packages/jest-mock/src/__tests__/jest_mock.test.js renamed to packages/jest-mock/src/__tests__/index.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
*
77
*/
88

9-
'use strict';
10-
11-
const vm = require('vm');
9+
import vm from 'vm';
1210

1311
describe('moduleMocker', () => {
1412
let moduleMocker;
@@ -182,6 +180,7 @@ describe('moduleMocker', () => {
182180
it('mocks ES2015 non-enumerable static properties and methods', () => {
183181
class ClassFoo {
184182
static foo() {}
183+
static fooProp: Function;
185184
}
186185
ClassFoo.fooProp = () => {};
187186

0 commit comments

Comments
 (0)