Skip to content

Commit

Permalink
fix: runIf().concurrent #36
Browse files Browse the repository at this point in the history
  • Loading branch information
zxch3n committed May 20, 2022
1 parent adbfb60 commit e4c0dfe
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions samples/basic/test/add.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { describe, expect, it } from 'vitest'
import { add } from '../src/add'

const skip = true
describe.runIf(skip).concurrent('runIf', () => {
it.skipIf(skip)('test case', () => {

})
})

describe('addition', () => {
describe('test suit', () => {
it('add', () => {
Expand Down
2 changes: 2 additions & 0 deletions src/pure/parsers/babel_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export const parse = (
|| deepGet(rootCallee, 'object').name
// handle cases where it's part of a tag (e.g. .each`table`)
|| deepGet(rootCallee, 'tag', 'object').name
// handle cases like .skipIf(true).concurrent
|| deepGet(rootCallee, 'object', 'callee', 'object').name

return [name, property]
}
Expand Down
11 changes: 11 additions & 0 deletions test/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ describe('parse', () => {
expect(out.itBlocks.length).toBe(1)
})

it('parse skipIf with concurrent #36', () => {
const out = parse(
'x.js',
''
+ 'describe.skipIf(true).concurrent(`test`, () => {\n'
+ '}); \n',
)

expect(out.describeBlocks.length).toBe(1)
})

it('parse decorator', () => {
const out = parse(
'x.ts',
Expand Down

0 comments on commit e4c0dfe

Please sign in to comment.