From 9a7399a769eda91424d948f0a04c602f67b75e82 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Fri, 24 May 2024 20:39:54 +0200 Subject: [PATCH] chore: disable sanitizers in esbuild tests (#2461) --- src/dev/builder_test.ts | 67 ++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/src/dev/builder_test.ts b/src/dev/builder_test.ts index 249be227..1dc08577 100644 --- a/src/dev/builder_test.ts +++ b/src/dev/builder_test.ts @@ -3,39 +3,44 @@ import * as path from "@std/path"; import { Builder } from "./builder.ts"; import { App } from "../app.ts"; -Deno.test("Builder - chain onTransformStaticFile", async () => { - const logs: string[] = []; - const builder = new Builder(); - builder.onTransformStaticFile( - { pluginName: "A", filter: /\.css$/ }, - () => { - logs.push("A"); - }, - ); - builder.onTransformStaticFile( - { pluginName: "B", filter: /\.css$/ }, - () => { - logs.push("B"); - }, - ); - builder.onTransformStaticFile( - { pluginName: "C", filter: /\.css$/ }, - () => { - logs.push("C"); - }, - ); +Deno.test({ + name: "Builder - chain onTransformStaticFile", + fn: async () => { + const logs: string[] = []; + const builder = new Builder(); + builder.onTransformStaticFile( + { pluginName: "A", filter: /\.css$/ }, + () => { + logs.push("A"); + }, + ); + builder.onTransformStaticFile( + { pluginName: "B", filter: /\.css$/ }, + () => { + logs.push("B"); + }, + ); + builder.onTransformStaticFile( + { pluginName: "C", filter: /\.css$/ }, + () => { + logs.push("C"); + }, + ); - const tmp = await Deno.makeTempDir(); - await Deno.writeTextFile(path.join(tmp, "foo.css"), "body { color: red; }"); - const app = new App({ - staticDir: tmp, - build: { - outDir: path.join(tmp, "dist"), - }, - }); - await builder.build(app); + const tmp = await Deno.makeTempDir(); + await Deno.writeTextFile(path.join(tmp, "foo.css"), "body { color: red; }"); + const app = new App({ + staticDir: tmp, + build: { + outDir: path.join(tmp, "dist"), + }, + }); + await builder.build(app); - expect(logs).toEqual(["A", "B", "C"]); + expect(logs).toEqual(["A", "B", "C"]); + }, + sanitizeOps: false, + sanitizeResources: false, }); Deno.test({