From 2f2d89c6199621cd2b979a908781682e22dccfa0 Mon Sep 17 00:00:00 2001 From: Electroid <3238291+Electroid@users.noreply.github.com> Date: Mon, 19 May 2025 19:12:54 +0000 Subject: [PATCH] `bun run prettier` --- test/regression/issue/19758.test.ts | 76 ++++++++++++++--------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/test/regression/issue/19758.test.ts b/test/regression/issue/19758.test.ts index c377b816ff..abde137fb5 100644 --- a/test/regression/issue/19758.test.ts +++ b/test/regression/issue/19758.test.ts @@ -1,50 +1,50 @@ -import { describe, it, beforeAll, expect } from 'bun:test'; +import { beforeAll, describe, expect, it } from "bun:test"; // Execution order log const executionLog: string[] = []; -describe('outer', () => { - console.log('EVALUATION: outer describe'); - +describe("outer", () => { + console.log("EVALUATION: outer describe"); + beforeAll(() => { - console.log('EXECUTION: outer beforeAll'); - executionLog.push('outer beforeAll'); + console.log("EXECUTION: outer beforeAll"); + executionLog.push("outer beforeAll"); }); - describe('inner1', () => { - console.log('EVALUATION: inner1 describe'); - + describe("inner1", () => { + console.log("EVALUATION: inner1 describe"); + beforeAll(() => { - console.log('EXECUTION: inner1 beforeAll'); - executionLog.push('inner1 beforeAll'); + console.log("EXECUTION: inner1 beforeAll"); + executionLog.push("inner1 beforeAll"); }); - - it('inner1 test', () => { - console.log('EXECUTION: inner1 test'); - executionLog.push('inner1 test'); + + it("inner1 test", () => { + console.log("EXECUTION: inner1 test"); + executionLog.push("inner1 test"); expect(true).toBe(true); }); }); - describe('inner2', () => { - console.log('EVALUATION: inner2 describe'); - + describe("inner2", () => { + console.log("EVALUATION: inner2 describe"); + beforeAll(() => { - console.log('EXECUTION: inner2 beforeAll'); - executionLog.push('inner2 beforeAll'); + console.log("EXECUTION: inner2 beforeAll"); + executionLog.push("inner2 beforeAll"); }); - - it('inner2 test', () => { - console.log('EXECUTION: inner2 test'); - executionLog.push('inner2 test'); + + it("inner2 test", () => { + console.log("EXECUTION: inner2 test"); + executionLog.push("inner2 test"); expect(true).toBe(true); }); }); // At the end of all tests, we'll check if execution order matches what we expect - it('should execute beforeAll hooks in the correct order', () => { - console.log('EXECUTION: outer test'); - + it("should execute beforeAll hooks in the correct order", () => { + console.log("EXECUTION: outer test"); + // For Jest-compatible behavior, the executionLog should be: // [ // 'outer beforeAll', // First execute outer beforeAll @@ -54,7 +54,7 @@ describe('outer', () => { // 'inner2 test', // Then inner2 test // 'outer test' // Then the outer test // ] - + // But currently in Bun, the executionLog is: // [ // 'outer beforeAll', @@ -64,17 +64,17 @@ describe('outer', () => { // 'inner2 test', // 'outer test' // ] - - console.log('Execution log:', executionLog); - + + console.log("Execution log:", executionLog); + // This test will initially fail, but after our fix it should pass expect(executionLog).toEqual([ - 'outer beforeAll', - 'inner1 beforeAll', - 'inner1 test', - 'inner2 beforeAll', - 'inner2 test', - 'outer test' + "outer beforeAll", + "inner1 beforeAll", + "inner1 test", + "inner2 beforeAll", + "inner2 test", + "outer test", ]); }); -}); \ No newline at end of file +});