-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
* feat: support `suite.each`, `test.each`, close #120 * chore: fix types * chore: update
- Loading branch information
Showing
18 changed files
with
177 additions
and
49 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
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ const external = [ | |
'birpc', | ||
'worker_threads', | ||
'vitest', | ||
'inspector', | ||
] | ||
|
||
export default () => [ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,45 @@ | ||
import { describe, expect, test } from 'vitest' | ||
|
||
test.each([ | ||
[1, 1, 2], | ||
[1, 2, 3], | ||
[2, 1, 3], | ||
])('add(%i, %i) -> %i', (a, b, expected) => { | ||
expect(a + b).toBe(expected) | ||
}) | ||
|
||
describe.each([ | ||
[1, 1, 2], | ||
[1, 2, 3], | ||
[2, 1, 3], | ||
])('describe add(%i, %i)', (a, b, expected) => { | ||
test(`returns ${expected}`, () => { | ||
expect(a + b).toBe(expected) | ||
}) | ||
|
||
test(`returned value not be greater than ${expected}`, () => { | ||
expect(a + b).not.toBeGreaterThan(expected) | ||
}) | ||
|
||
test(`returned value not be less than ${expected}`, () => { | ||
expect(a + b).not.toBeLessThan(expected) | ||
}) | ||
}) | ||
|
||
describe.each([ | ||
{ a: 1, b: 1, expected: 2 }, | ||
{ a: 1, b: 2, expected: 3 }, | ||
{ a: 2, b: 1, expected: 3 }, | ||
])('describe object add($a, $b)', ({ a, b, expected }) => { | ||
test(`returns ${expected}`, () => { | ||
expect(a + b).toBe(expected) | ||
}) | ||
|
||
test(`returned value not be greater than ${expected}`, () => { | ||
expect(a + b).not.toBeGreaterThan(expected) | ||
}) | ||
|
||
test(`returned value not be less than ${expected}`, () => { | ||
expect(a + b).not.toBeLessThan(expected) | ||
}) | ||
}) |
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
Oops, something went wrong.