jest-extended-global-fail-pass
v1.8.8
Published
use jest extended fail & pass global instead of expect(1).fail & expect(1).pass
Downloads
9
Readme
jest-extended-global-fail-pass
Use jest extended fail & pass global instead of expect(1).fail & expect(1).pass
Usage
yarn add --dev jest jest-extended jest-extended-global-fail-pass
// jest.config.js
setupFilesAfterEnv: ['jest-extended-global-fail-pass/setup'],
// in your jest test file
test('test fail', () => {
// use fail as a global function instead of expect(1).fail('message')
fail('message')
})
test('test pass', () => {
// use pass as a global function instead of expect(1).pass('message')
pass('message')
})
Use TypeScript
Put a typings.d.ts
file in your tests directory:
import 'jest-extended'
import 'jest-extended-global-fail-pass'
More to read https://github.com/jest-community/jest-extended