https://github.com/unstubbable/wallaby-ts-jest-mock
Testing Wallaby.js with TypeScript and jest.mock
https://github.com/unstubbable/wallaby-ts-jest-mock
Last synced: 9 months ago
JSON representation
Testing Wallaby.js with TypeScript and jest.mock
- Host: GitHub
- URL: https://github.com/unstubbable/wallaby-ts-jest-mock
- Owner: unstubbable
- Created: 2017-07-12T11:38:02.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-12T14:43:42.000Z (over 8 years ago)
- Last Synced: 2025-02-06T03:23:14.114Z (11 months ago)
- Language: JavaScript
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wallaby-ts-jest-mock
Testing Wallaby.js with TypeScript and jest.mock
The `jest.mock` calls need to be hoisted above the require calls to make them work. This is done by `babel-preset-jest` via `ts-jest`. With wallaby this transform is apparently not applied.
## Usage/Reproduction
### Setup
Run `yarn` or `npm install`.
### Execute tests
#### On the command line
Run `yarn test` or `npm test`.
The one test should be succesful.
#### With Wallaby.js
Start wallaby in the IDE of your choice.
~~The test will probably fail.~~ Fixed with [#1](https://github.com/KingHenne/wallaby-ts-jest-mock/pull/1).