Skip to content

Commit

Permalink
chore: migrate jest-mock to TypeScript (jestjs#7847)
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee authored and captain-yossarian committed Jul 18, 2019
1 parent 87c1478 commit f86395d
Show file tree
Hide file tree
Showing 11 changed files with 339 additions and 127 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = {
{argsIgnorePattern: '^_'},
],
'import/order': 'error',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
},
},
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- `[@jest/types]`: New package to handle shared types ([#7834](https://github.com/facebook/jest/pull/7834))
- `[jest-util]`: Migrate to TypeScript ([#7844](https://github.com/facebook/jest/pull/7844))
- `[jest-watcher]`: Migrate to TypeScript ([#7843](https://github.com/facebook/jest/pull/7843))
- `[jest-mock]`: Migrate to TypeScript ([#7847](https://github.com/facebook/jest/pull/7847))

### Performance

Expand Down
4 changes: 4 additions & 0 deletions packages/jest-mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
"engines": {
"node": ">= 6"
},
"dependencies": {
"@jest/types": "^24.1.0"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"browser": "build-es5/index.js",
"gitHead": "634e5a54f46b2a62d1dc81a170562e6f4e55ad60"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
*
*/

'use strict';

const vm = require('vm');
import vm from 'vm';

describe('moduleMocker', () => {
let moduleMocker;
Expand Down Expand Up @@ -182,6 +180,7 @@ describe('moduleMocker', () => {
it('mocks ES2015 non-enumerable static properties and methods', () => {
class ClassFoo {
static foo() {}
static fooProp: Function;
}
ClassFoo.fooProp = () => {};

Expand Down
Loading

0 comments on commit f86395d

Please sign in to comment.