-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…3603) Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>
- Loading branch information
1 parent
6ad8ff6
commit 9a11762
Showing
9 changed files
with
64 additions
and
1 deletion.
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
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
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 { expect, test } from 'vitest' | ||
|
||
let number = 0 | ||
test('should passed', () => { | ||
expect(number++).toBe(3) | ||
}) | ||
|
||
test('retry but still failed', () => { | ||
expect(number++).toBe(4) | ||
}) |
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 { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
include: ['*.test.ts'], | ||
retry: 3, | ||
}, | ||
}) |
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,26 @@ | ||
import path from 'node:path' | ||
import { describe, expect, test } from 'vitest' | ||
import { runVitest } from '../../test-utils' | ||
|
||
const root = path.resolve('./fixtures/retry') | ||
function run(testNamePattern?: string) { | ||
return runVitest({ | ||
root, | ||
testNamePattern, | ||
}) | ||
} | ||
|
||
describe('retry', () => { | ||
test('should passed', async () => { | ||
const { stdout } = await run('should passed') | ||
expect(stdout).toContain('1 passed') | ||
}) | ||
|
||
test('retry but still failed', async () => { | ||
const { stdout } = await run('retry but still failed') | ||
expect(stdout).toContain('expected 1 to be 4') | ||
expect(stdout).toContain('expected 2 to be 4') | ||
expect(stdout).toContain('expected 3 to be 4') | ||
expect(stdout).toContain('1 failed') | ||
}) | ||
}) |