From 602807686ab02bafb8880fbb4f4fca40b6558ee9 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 16 Aug 2023 17:30:30 +0200 Subject: [PATCH] fix: load snapshot message shown for build (#1640) --- src/dev/build.ts | 2 +- tests/build_test.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/dev/build.ts b/src/dev/build.ts index 24cd639c..7780ec36 100644 --- a/src/dev/build.ts +++ b/src/dev/build.ts @@ -17,7 +17,7 @@ export async function build( const ctx = await ServerContext.fromManifest(manifest, { ...opts, - skipSnapshot: false, + skipSnapshot: true, }); // Bundle assets diff --git a/tests/build_test.ts b/tests/build_test.ts index 231700af..7a9de0e3 100644 --- a/tests/build_test.ts +++ b/tests/build_test.ts @@ -9,7 +9,7 @@ Deno.test("build snapshot and restore from it", async (t) => { try { await t.step("build snapshot", async () => { - await new Deno.Command(Deno.execPath(), { + const res = await new Deno.Command(Deno.execPath(), { args: [ "run", "-A", @@ -17,10 +17,17 @@ Deno.test("build snapshot and restore from it", async (t) => { "build", ], stdin: "null", - stdout: "inherit", + stdout: "piped", stderr: "inherit", }).output(); + const decoder = new TextDecoder(); + const stdout = decoder.decode(res.stdout); + assert( + !/Using snapshot found at/.test(stdout), + "Using snapshot message was shown during build", + ); + assert((await Deno.stat(outDir)).isDirectory, "Missing output directory"); });