From ea46fdcfbc4ccbee01937b49ac5a3ffb86654f28 Mon Sep 17 00:00:00 2001 From: arturgawlik Date: Sun, 15 Dec 2024 18:16:04 +0100 Subject: [PATCH] fix formatring --- test/loader.test.js | 128 ++++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/test/loader.test.js b/test/loader.test.js index 0fb6e145f..41c4ce657 100644 --- a/test/loader.test.js +++ b/test/loader.test.js @@ -3,93 +3,93 @@ const { test } = require("node:test"); const { match, doesNotMatch, strictEqual } = require("node:assert"); test("should work as a loader", async () => { - const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", - "--no-warnings", - "--import=./dist/register-strip.mjs", - fixturesPath("hello.ts"), - ]); + const result = await spawnPromisified(process.execPath, [ + "--experimental-strip-types", + "--no-warnings", + "--import=./dist/register-strip.mjs", + fixturesPath("hello.ts"), + ]); - strictEqual(result.stderr, ""); - match(result.stdout, /Hello, TypeScript!/); - strictEqual(result.code, 0); + strictEqual(result.stderr, ""); + match(result.stdout, /Hello, TypeScript!/); + strictEqual(result.code, 0); }); test("should not work with enums", async () => { - const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", - "--no-warnings", - "--import=./dist/register-strip.mjs", - fixturesPath("enum.ts"), - ]); + const result = await spawnPromisified(process.execPath, [ + "--experimental-strip-types", + "--no-warnings", + "--import=./dist/register-strip.mjs", + fixturesPath("enum.ts"), + ]); - strictEqual(result.stdout, ""); - match(result.stderr, /TypeScript enum is not supported in strip-only mode/); - strictEqual(result.code, 1); + strictEqual(result.stdout, ""); + match(result.stderr, /TypeScript enum is not supported in strip-only mode/); + strictEqual(result.code, 1); }); test("should work with enums", async () => { - const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", - "--no-warnings", - "--import=./dist/register-transform.mjs", - fixturesPath("enum.ts"), - ]); + const result = await spawnPromisified(process.execPath, [ + "--experimental-strip-types", + "--no-warnings", + "--import=./dist/register-transform.mjs", + fixturesPath("enum.ts"), + ]); - match(result.stdout, /Hello, TypeScript!/); - strictEqual(result.stderr, ""); - strictEqual(result.code, 0); + match(result.stdout, /Hello, TypeScript!/); + strictEqual(result.stderr, ""); + strictEqual(result.code, 0); }); test("should warn and inaccurate stracktrace", async () => { - const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", - "--import=./dist/register-transform.mjs", - fixturesPath("stacktrace.ts"), - ]); + const result = await spawnPromisified(process.execPath, [ + "--experimental-strip-types", + "--import=./dist/register-transform.mjs", + fixturesPath("stacktrace.ts"), + ]); - strictEqual(result.stdout, ""); - match(result.stderr, /Source maps are disabled/); - match(result.stderr, /stacktrace.ts:5:7/); // inaccurate - strictEqual(result.code, 1); + strictEqual(result.stdout, ""); + match(result.stderr, /Source maps are disabled/); + match(result.stderr, /stacktrace.ts:5:7/); // inaccurate + strictEqual(result.code, 1); }); test("should not warn and accurate stracktrace", async () => { - const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", - "--enable-source-maps", - "--import=./dist/register-transform.mjs", - fixturesPath("stacktrace.ts"), - ]); + const result = await spawnPromisified(process.execPath, [ + "--experimental-strip-types", + "--enable-source-maps", + "--import=./dist/register-transform.mjs", + fixturesPath("stacktrace.ts"), + ]); - doesNotMatch(result.stderr, /Source maps are disabled/); - strictEqual(result.stdout, ""); - match(result.stderr, /stacktrace.ts:4:7/); // accurate - strictEqual(result.code, 1); + doesNotMatch(result.stderr, /Source maps are disabled/); + strictEqual(result.stdout, ""); + match(result.stderr, /stacktrace.ts:4:7/); // accurate + strictEqual(result.code, 1); }); test("should call nextLoader for non-typescript files for striping", async () => { - const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", - "--no-warnings", - "--import=./dist/register-strip.mjs", - fixturesPath("hello.js"), - ]); + const result = await spawnPromisified(process.execPath, [ + "--experimental-strip-types", + "--no-warnings", + "--import=./dist/register-strip.mjs", + fixturesPath("hello.js"), + ]); - strictEqual(result.stderr, ""); - match(result.stdout, /Hello, JavaScript!/); - strictEqual(result.code, 0); + strictEqual(result.stderr, ""); + match(result.stdout, /Hello, JavaScript!/); + strictEqual(result.code, 0); }); test("should call nextLoader for non-typescript files for transform", async () => { - const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", - "--no-warnings", - "--import=./dist/register-transform.mjs", - fixturesPath("hello.js"), - ]); + const result = await spawnPromisified(process.execPath, [ + "--experimental-strip-types", + "--no-warnings", + "--import=./dist/register-transform.mjs", + fixturesPath("hello.js"), + ]); - strictEqual(result.stderr, ""); - match(result.stdout, /Hello, JavaScript!/); - strictEqual(result.code, 0); + strictEqual(result.stderr, ""); + match(result.stdout, /Hello, JavaScript!/); + strictEqual(result.code, 0); });