From 5a90513ed16d9a69e1588c149e19fe1401136db7 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 20 Sep 2024 13:52:46 +0100 Subject: [PATCH] fixup! implement webpack chunks file updating using ast manipulation add missing describe block --- ...pdated-webpack-chunks-file-content.test.ts | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/builder/src/build/patches/investigated/update-webpack-chunks-file/get-updated-webpack-chunks-file-content.test.ts b/builder/src/build/patches/investigated/update-webpack-chunks-file/get-updated-webpack-chunks-file-content.test.ts index da6f33b4..1f31cb82 100644 --- a/builder/src/build/patches/investigated/update-webpack-chunks-file/get-updated-webpack-chunks-file-content.test.ts +++ b/builder/src/build/patches/investigated/update-webpack-chunks-file/get-updated-webpack-chunks-file-content.test.ts @@ -1,23 +1,25 @@ import { readFile } from "node:fs/promises"; -import { expect, test } from "vitest"; +import { expect, test, describe } from "vitest"; import { getUpdatedWebpackChunksFileContent } from "./get-updated-webpack-chunks-file-content"; -test("works as expected on unminified code", async () => { - const fileContent = await readFile( - `${import.meta.dirname}/test-fixtures/unminified-webpacks-file.js`, - "utf8" - ); - const updatedContent = await getUpdatedWebpackChunksFileContent(fileContent, ["658"]); - expect(updatedContent).toMatchFileSnapshot("./test-snapshots/unminified-webpacks-file.js"); -}); +describe("getUpdatedWebpackChunksFileContent", () => { + test("works as expected on unminified code", async () => { + const fileContent = await readFile( + `${import.meta.dirname}/test-fixtures/unminified-webpacks-file.js`, + "utf8" + ); + const updatedContent = await getUpdatedWebpackChunksFileContent(fileContent, ["658"]); + expect(updatedContent).toMatchFileSnapshot("./test-snapshots/unminified-webpacks-file.js"); + }); -test("works as expected on minified code", async () => { - const fileContent = await readFile( - `${import.meta.dirname}/test-fixtures/minified-webpacks-file.js`, - "utf8" - ); - const updatedContent = await getUpdatedWebpackChunksFileContent(fileContent, ["658"]); - expect(updatedContent).toMatchFileSnapshot("./test-snapshots/minified-webpacks-file.js"); + test("works as expected on minified code", async () => { + const fileContent = await readFile( + `${import.meta.dirname}/test-fixtures/minified-webpacks-file.js`, + "utf8" + ); + const updatedContent = await getUpdatedWebpackChunksFileContent(fileContent, ["658"]); + expect(updatedContent).toMatchFileSnapshot("./test-snapshots/minified-webpacks-file.js"); + }); });