https://github.com/wangtao0101/jest-condition
An enhancer for jest it and describe to dynamic skip some suits and tests.
https://github.com/wangtao0101/jest-condition
javascript jest skip typescript
Last synced: about 2 months ago
JSON representation
An enhancer for jest it and describe to dynamic skip some suits and tests.
- Host: GitHub
- URL: https://github.com/wangtao0101/jest-condition
- Owner: wangtao0101
- License: mit
- Created: 2018-09-05T05:22:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-05T10:25:03.000Z (almost 8 years ago)
- Last Synced: 2025-03-04T12:28:04.405Z (over 1 year ago)
- Topics: javascript, jest, skip, typescript
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jest Condition
An enhancer for jest it and describe to dynamic skip some suits and tests.
## Install
```
npm install jest-condition --save-dev
```
set jest config file
```
"setupTestFrameworkScriptFile": "jest-condition"
```
if you have your own setupTestFrameworkScriptFile, you should require jest-condition in top of you own setupTestFrameworkScriptFile;
```
require('jest-condition');
```
## Usage
```
it.condition(true)('test condition', async () => {
});
// you can also add skip or only after condition when debug
it.condition(true).skip('test condition skip', async () => {
});
it.condition(true).only('test condition skip', async () => {
});
describe.condition(true)('describe condition', () => {
});
describe.condition(true).skip('describe condition skip', () => {
});
describe.condition(true).only('describe condition skip', () => {
});
```
## Typescript
use files in tsconfig.json
```
{
"files": [
"node_modules/jest-condition/index.d.ts"
],
}
```