@@ -104,7 +104,7 @@ export class TestTypeImpl {
104104 details = fnOrDetails ;
105105 }
106106
107- const validatedDetails = validateTestDetails ( details , location ) ;
107+ const validatedDetails = validateTestDetails ( details ) ;
108108 const test = new TestCase ( title , body , this , location ) ;
109109 test . _requireFile = suite . _requireFile ;
110110 test . annotations . push ( ...validatedDetails . annotations ) ;
@@ -114,9 +114,9 @@ export class TestTypeImpl {
114114 if ( type === 'only' || type === 'fail.only' )
115115 test . _only = true ;
116116 if ( type === 'skip' || type === 'fixme' || type === 'fail' )
117- test . annotations . push ( { type, location } ) ;
117+ test . annotations . push ( { type } ) ;
118118 else if ( type === 'fail.only' )
119- test . annotations . push ( { type : 'fail' , location } ) ;
119+ test . annotations . push ( { type : 'fail' } ) ;
120120 }
121121
122122 private _describe ( type : 'default' | 'only' | 'serial' | 'serial.only' | 'parallel' | 'parallel.only' | 'skip' | 'fixme' , location : Location , titleOrFn : string | Function , fnOrDetails ?: TestDetails | Function , fn ?: Function ) {
@@ -143,7 +143,7 @@ export class TestTypeImpl {
143143 body = fn ! ;
144144 }
145145
146- const validatedDetails = validateTestDetails ( details , location ) ;
146+ const validatedDetails = validateTestDetails ( details ) ;
147147 const child = new Suite ( title , 'describe' ) ;
148148 child . _requireFile = suite . _requireFile ;
149149 child . location = location ;
@@ -158,7 +158,7 @@ export class TestTypeImpl {
158158 if ( type === 'parallel' || type === 'parallel.only' )
159159 child . _parallelMode = 'parallel' ;
160160 if ( type === 'skip' || type === 'fixme' )
161- child . _staticAnnotations . push ( { type, location } ) ;
161+ child . _staticAnnotations . push ( { type } ) ;
162162
163163 for ( let parent : Suite | undefined = suite ; parent ; parent = parent . parent ) {
164164 if ( parent . _parallelMode === 'serial' && child . _parallelMode === 'parallel' )
@@ -229,7 +229,7 @@ export class TestTypeImpl {
229229 if ( modifierArgs . length >= 1 && ! modifierArgs [ 0 ] )
230230 return ;
231231 const description = modifierArgs [ 1 ] ;
232- suite . _staticAnnotations . push ( { type, description, location } ) ;
232+ suite . _staticAnnotations . push ( { type, description } ) ;
233233 }
234234 return ;
235235 }
@@ -239,7 +239,7 @@ export class TestTypeImpl {
239239 throw new Error ( `test.${ type } () can only be called inside test, describe block or fixture` ) ;
240240 if ( typeof modifierArgs [ 0 ] === 'function' )
241241 throw new Error ( `test.${ type } () with a function can only be called inside describe block` ) ;
242- testInfo . _modifier ( type , location , modifierArgs as [ any , any ] ) ;
242+ testInfo [ type ] ( ... modifierArgs as [ any , any ] ) ;
243243 }
244244
245245 private _setTimeout ( location : Location , timeout : number ) {
@@ -276,7 +276,7 @@ export class TestTypeImpl {
276276 let result : Awaited < ReturnType < typeof raceAgainstDeadline < T > > > | undefined = undefined ;
277277 result = await raceAgainstDeadline ( async ( ) => {
278278 try {
279- return await step . info . _runStepBody ( expectation === 'skip' , body , step . location ) ;
279+ return await step . info . _runStepBody ( expectation === 'skip' , body ) ;
280280 } catch ( e ) {
281281 // If the step timed out, the test fixtures will tear down, which in turn
282282 // will abort unfinished actions in the step body. Record such errors here.
@@ -315,9 +315,8 @@ function throwIfRunningInsideJest() {
315315 }
316316}
317317
318- function validateTestDetails ( details : TestDetails , location : Location ) {
319- const originalAnnotations = Array . isArray ( details . annotation ) ? details . annotation : ( details . annotation ? [ details . annotation ] : [ ] ) ;
320- const annotations = originalAnnotations . map ( annotation => ( { ...annotation , location } ) ) ;
318+ function validateTestDetails ( details : TestDetails ) {
319+ const annotations = Array . isArray ( details . annotation ) ? details . annotation : ( details . annotation ? [ details . annotation ] : [ ] ) ;
321320 const tags = Array . isArray ( details . tag ) ? details . tag : ( details . tag ? [ details . tag ] : [ ] ) ;
322321 for ( const tag of tags ) {
323322 if ( tag [ 0 ] !== '@' )
0 commit comments