-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! implement webpack chunks file updating using ast manipulation
add missing describe block
- Loading branch information
1 parent
bc52302
commit 5a90513
Showing
1 changed file
with
18 additions
and
16 deletions.
There are no files selected for viewing
34 changes: 18 additions & 16 deletions
34
...s/investigated/update-webpack-chunks-file/get-updated-webpack-chunks-file-content.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
}); | ||
}); |