From c94feda997f1f80e185def410af6ab93b54fea0b Mon Sep 17 00:00:00 2001 From: jeshecdom Date: Tue, 28 Jan 2025 15:44:03 +0100 Subject: [PATCH] refactor: code prettier pass. --- .../test/short-circuit-inits.spec.ts | 60 +++++++++---------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/src/optimizer/test/short-circuit-inits.spec.ts b/src/optimizer/test/short-circuit-inits.spec.ts index ccf979acf..e93fa3d66 100644 --- a/src/optimizer/test/short-circuit-inits.spec.ts +++ b/src/optimizer/test/short-circuit-inits.spec.ts @@ -12,40 +12,36 @@ import { loadCases } from "../../utils/loadCases"; describe("short-circuit-initialization", () => { for (const r of loadCases(__dirname + "/success/")) { - it(`${r.name} should pass boolean short-circuiting during initialization`, - () => { - const Ast = getAstFactory(); - let ctx = openContext( - new CompilerContext(), - [{ code: r.code, path: "", origin: "user" }], - [], - getParser(Ast, defaultParser), - ); - ctx = featureEnable(ctx, "external"); + it(`${r.name} should pass boolean short-circuiting during initialization`, () => { + const Ast = getAstFactory(); + let ctx = openContext( + new CompilerContext(), + [{ code: r.code, path: "", origin: "user" }], + [], + getParser(Ast, defaultParser), + ); + ctx = featureEnable(ctx, "external"); + ctx = resolveDescriptors(ctx, Ast); + ctx = resolveStatements(ctx, Ast); + ctx = resolveSignatures(ctx, Ast); + expect(getAllExpressionTypes(ctx)).toMatchSnapshot(); + }); + } + for (const r of loadCases(__dirname + "/failed/")) { + it(`${r.name} should fail boolean short-circuiting during initialization`, () => { + const Ast = getAstFactory(); + let ctx = openContext( + new CompilerContext(), + [{ code: r.code, path: "", origin: "user" }], + [], + getParser(Ast, defaultParser), + ); + ctx = featureEnable(ctx, "external"); + expect(() => { ctx = resolveDescriptors(ctx, Ast); ctx = resolveStatements(ctx, Ast); ctx = resolveSignatures(ctx, Ast); - expect(getAllExpressionTypes(ctx)).toMatchSnapshot(); - }, - ); - } - for (const r of loadCases(__dirname + "/failed/")) { - it(`${r.name} should fail boolean short-circuiting during initialization`, - () => { - const Ast = getAstFactory(); - let ctx = openContext( - new CompilerContext(), - [{ code: r.code, path: "", origin: "user" }], - [], - getParser(Ast, defaultParser), - ); - ctx = featureEnable(ctx, "external"); - expect(() => { - ctx = resolveDescriptors(ctx, Ast); - ctx = resolveStatements(ctx, Ast); - ctx = resolveSignatures(ctx, Ast); - }).toThrowErrorMatchingSnapshot(); - }, - ); + }).toThrowErrorMatchingSnapshot(); + }); } });