You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/advanced/test-specification.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,15 @@ You can only create a specification by calling [`createSpecification`](/api/adva
7
7
```ts
8
8
const specification =project.createSpecification(
9
9
resolve('./example.test.ts'),
10
-
[20, 40], // optional test lines
10
+
{
11
+
testLines: [20, 40],
12
+
testNamePattern:/hello world/,
13
+
testIds: ['1223128da3_0_0_0', '1223128da3_0_0'],
14
+
} // optional test filters
11
15
)
12
16
```
13
17
14
-
`createSpecification` expects resolved module ID. It doesn't auto-resolve the file or check that it exists on the file system.
18
+
`createSpecification` expects resolved module identifier. It doesn't auto-resolve the file or check that it exists on the file system.
15
19
16
20
## taskId
17
21
@@ -40,7 +44,7 @@ Instance of [`TestModule`](/api/advanced/test-module) associated with the specif
40
44
The [`pool`](/config/#pool) in which the test module will run.
41
45
42
46
::: danger
43
-
It's possible to have multiple pools in a single test project with [`poolMatchGlob`](/config/#poolmatchglob) and [`typecheck.enabled`](/config/#typecheck-enabled). This means it's possible to have several specifications with the same `moduleId` but different `pool`. In Vitest 4, the project will only support a single pool, and this property will be removed.
47
+
It's possible to have multiple pools in a single test project with [`typecheck.enabled`](/config/#typecheck-enabled). This means it's possible to have several specifications with the same `moduleId` but different `pool`. In later versions, the project will only support a single pool.
44
48
:::
45
49
46
50
## testLines
@@ -70,6 +74,14 @@ describe('a group of tests', () => { // [!code error]
A regexp that matches the name of the test in this module. This value will override the global [`testNamePattern`](/config/testnamepattern) option if it's set.
80
+
81
+
## testIds <Version>4.1.0</Version> {#testids}
82
+
83
+
The ids of tasks inside of this specification to run.
0 commit comments