@@ -7,7 +7,6 @@ import type {
7
7
TaskMeta ,
8
8
} from '@vitest/runner'
9
9
import type { TestError } from '@vitest/utils'
10
- import { getTestName } from '../../utils/tasks'
11
10
import type { WorkspaceProject } from '../workspace'
12
11
import { TestProject } from '../reported-workspace-project'
13
12
@@ -101,7 +100,12 @@ export class TestCase extends ReportedTaskImplementation {
101
100
*/
102
101
public get fullName ( ) : string {
103
102
if ( this . #fullName === undefined ) {
104
- this . #fullName = getTestName ( this . task , ' > ' )
103
+ if ( this . parent . type !== 'module' ) {
104
+ this . #fullName = `${ this . parent . fullName } > ${ this . name } `
105
+ }
106
+ else {
107
+ this . #fullName = this . name
108
+ }
105
109
}
106
110
return this . #fullName
107
111
}
@@ -198,7 +202,7 @@ class TestCollection {
198
202
/**
199
203
* Filters all tests that are part of this collection and its children.
200
204
*/
201
- * allTests ( state ?: TestResult [ 'state' ] | 'running' ) : IterableIterator < TestCase > {
205
+ * allTests ( state ?: TestResult [ 'state' ] | 'running' ) : Generator < TestCase , undefined , void > {
202
206
for ( const child of this ) {
203
207
if ( child . type === 'suite' ) {
204
208
yield * child . children . allTests ( state )
@@ -218,7 +222,7 @@ class TestCollection {
218
222
/**
219
223
* Filters only the tests that are part of this collection.
220
224
*/
221
- * tests ( state ?: TestResult [ 'state' ] | 'running' ) : IterableIterator < TestCase > {
225
+ * tests ( state ?: TestResult [ 'state' ] | 'running' ) : Generator < TestCase , undefined , void > {
222
226
for ( const child of this ) {
223
227
if ( child . type !== 'test' ) {
224
228
continue
@@ -239,7 +243,7 @@ class TestCollection {
239
243
/**
240
244
* Filters only the suites that are part of this collection.
241
245
*/
242
- * suites ( ) : IterableIterator < TestSuite > {
246
+ * suites ( ) : Generator < TestSuite , undefined , void > {
243
247
for ( const child of this ) {
244
248
if ( child . type === 'suite' ) {
245
249
yield child
@@ -250,7 +254,7 @@ class TestCollection {
250
254
/**
251
255
* Filters all suites that are part of this collection and its children.
252
256
*/
253
- * allSuites ( ) : IterableIterator < TestSuite > {
257
+ * allSuites ( ) : Generator < TestSuite , undefined , void > {
254
258
for ( const child of this ) {
255
259
if ( child . type === 'suite' ) {
256
260
yield child
@@ -259,7 +263,7 @@ class TestCollection {
259
263
}
260
264
}
261
265
262
- * [ Symbol . iterator ] ( ) : IterableIterator < TestSuite | TestCase > {
266
+ * [ Symbol . iterator ] ( ) : Generator < TestSuite | TestCase , undefined , void > {
263
267
for ( const task of this . #task. tasks ) {
264
268
yield getReportedTask ( this . #project, task ) as TestSuite | TestCase
265
269
}
@@ -328,7 +332,12 @@ export class TestSuite extends SuiteImplementation {
328
332
*/
329
333
public get fullName ( ) : string {
330
334
if ( this . #fullName === undefined ) {
331
- this . #fullName = getTestName ( this . task , ' > ' )
335
+ if ( this . parent . type !== 'module' ) {
336
+ this . #fullName = `${ this . parent . fullName } > ${ this . name } `
337
+ }
338
+ else {
339
+ this . #fullName = this . name
340
+ }
332
341
}
333
342
return this . #fullName
334
343
}
0 commit comments