-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add `skip` to `describe`, `it` and `test` methods * docs: include docs
- Loading branch information
1 parent
d8ba910
commit b756605
Showing
9 changed files
with
109 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Write } from '../../../services/write.js'; | ||
import { indentation } from '../../../configs/indentation.js'; | ||
import { format } from '../../../services/format.js'; | ||
|
||
export const skip = (message: string, _cb?: () => unknown) => | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
Write.log( | ||
`${indentation.hasDescribe ? ' ' : ''}${format(`◯ ${message}`).info().bold()}` | ||
); |
9 changes: 9 additions & 0 deletions
9
test/__fixtures__/e2e/final-results/skip-describe-it/skip.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { exit } from 'node:process'; | ||
import { describe } from '../../../../../src/modules/helpers/describe.js'; | ||
import { it } from '../../../../../src/modules/helpers/it/core.js'; | ||
|
||
describe('Dont skip', () => { | ||
it.skip('Mixed skips in the same file should not be counted', () => { | ||
exit(1); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
test/__fixtures__/e2e/final-results/skip-describe/skip.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { exit } from 'node:process'; | ||
import { describe } from '../../../../../src/modules/helpers/describe.js'; | ||
import { it } from '../../../../../src/modules/helpers/it/core.js'; | ||
|
||
describe.skip('Some skip', () => { | ||
exit(1); | ||
}); | ||
|
||
describe.skip('Multiple skips in the same file should not be counted', () => { | ||
exit(1); | ||
}); | ||
|
||
it.skip('Mixed skips in the same file should not be counted', () => { | ||
exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { exit } from 'node:process'; | ||
import { it } from '../../../../../src/modules/helpers/it/core.js'; | ||
|
||
it.skip('Some skip', () => { | ||
exit(1); | ||
}); | ||
|
||
it.skip('Multiple skips in the same file should not be counted', () => { | ||
exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { exit } from 'node:process'; | ||
import { skip } from '../../../../../src/modules/helpers/skip.js'; | ||
|
||
skip('Some skip'); | ||
exit(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@wellwelwel To draw your attention, typings of
test()
do not, but typings oftest.skip()
do require themessage
argument. Minor detail, not a problem for me (;