@@ -283,35 +283,7 @@ for(let i = 0; i < 3; i++) {
283283 } ,
284284 } ) ;
285285 } ) ;
286- } ) ;
287-
288- describe . each ( [
289- { type : "dom" } ,
290- { type : "javascript" } ,
291- { type : "python" } ,
292- ] as const ) ( "$type test evaluator with beforeEach" , ( { type } ) => {
293- it ( "should evaluate the beforeEach hook before each test" , async ( ) => {
294- const result = await page . evaluate ( async ( type ) => {
295- const runner = await window . FCCTestRunner . createTestRunner ( {
296- type,
297- hooks : {
298- beforeEach : "globalThis.x = 1;" ,
299- } ,
300- } ) ;
301- const one = await runner . runTest ( "x += 1; assert.equal(x, 2);" ) ;
302- const two = await runner . runTest ( "x += 1; assert.equal(x, 2);" ) ;
303- return [ one , two ] ;
304- } , type ) ;
305-
306- expect ( result ) . toEqual ( [ { pass : true } , { pass : true } ] ) ;
307- } ) ;
308- } ) ;
309286
310- describe . each ( [
311- { type : "dom" } ,
312- { type : "javascript" } ,
313- { type : "python" } ,
314- ] as const ) ( "$type test evaluator with beforeEach" , ( { type } ) => {
315287 it ( "should evaluate the beforeEach hook before each test" , async ( ) => {
316288 const result = await page . evaluate ( async ( type ) => {
317289 const runner = await window . FCCTestRunner . createTestRunner ( {
@@ -322,21 +294,12 @@ for(let i = 0; i < 3; i++) {
322294 } ) ;
323295 const one = await runner . runTest ( "x += 1; assert.equal(x, 2);" ) ;
324296 const two = await runner . runTest ( "x += 1; assert.equal(x, 2);" ) ;
325-
326- // Clean up the global variable
327- await runner . runTest ( "delete globalThis.x;" ) ;
328297 return [ one , two ] ;
329298 } , type ) ;
330299
331300 expect ( result ) . toEqual ( [ { pass : true } , { pass : true } ] ) ;
332301 } ) ;
333- } ) ;
334302
335- describe . each ( [
336- { type : "dom" } ,
337- { type : "javascript" } ,
338- { type : "python" } ,
339- ] as const ) ( "$type test evaluator with beforeEach" , ( { type } ) => {
340303 it ( "should evaluate the beforeAll hook once before all tests" , async ( ) => {
341304 const result = await page . evaluate ( async ( type ) => {
342305 const runner = await window . FCCTestRunner . createTestRunner ( {
@@ -355,13 +318,7 @@ for(let i = 0; i < 3; i++) {
355318
356319 expect ( result ) . toEqual ( [ { pass : true } , { pass : true } ] ) ;
357320 } ) ;
358- } ) ;
359321
360- describe . each ( [
361- { type : "dom" } ,
362- { type : "javascript" } ,
363- { type : "python" } ,
364- ] as const ) ( "$type test evaluator" , ( { type } ) => {
365322 it ( "should evaluate the afterEach hook after each test" , async ( ) => {
366323 const afterEachResult = await page . evaluate ( async ( type ) => {
367324 const runner = await window . FCCTestRunner . createTestRunner ( {
0 commit comments