Skip to content

Commit

Permalink
test: revert test case
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Jul 21, 2024
1 parent 60a299b commit 5bfc1f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
18 changes: 1 addition & 17 deletions test/core/test/test-name-pattern.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
import { afterAll, assert, describe, it } from 'vitest'

let testCount = 0

afterAll(() => {
if (testCount !== 4) {
assert.fail(`Expected to run 4 tests, instead ${testCount}`)
}
})
import { assert, describe, it } from 'vitest'

it('does include root test', () => {
assert.equal(Math.sqrt(4), 2)
testCount++
})

it('does not include test that is root and unmatched', () => {
Expand All @@ -20,7 +11,6 @@ it('does not include test that is root and unmatched', () => {
describe('testNamePattern', () => {
it('does include test in describe', () => {
assert.equal(Math.sqrt(4), 2)
testCount++
})

it('does not include test that is in describe and unmatched', () => {
Expand All @@ -30,16 +20,10 @@ describe('testNamePattern', () => {
describe('nested describe', () => {
it('does include nested test', () => {
assert.equal(Math.sqrt(4), 2)
testCount++
})

it('does not include test that is nested and unmatched', () => {
assert.fail('unmatched test was included')
})
})
})

it('Match test name from the start', () => {
assert.equal(Math.sqrt(4), 2)
testCount++
})
2 changes: 1 addition & 1 deletion test/core/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default defineConfig({
setupFiles: [
'./test/setup.ts',
],
testNamePattern: '(does include)|(^Match test name from the start)',
testNamePattern: '^((?!does not include test that).)*$',
coverage: {
provider: 'istanbul',
reporter: ['text', 'html'],
Expand Down

0 comments on commit 5bfc1f4

Please sign in to comment.