Skip to content

Commit

Permalink
test: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jan 10, 2024
1 parent 453f344 commit b14dbb9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions test/TestCache.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ describe("TestCache", () => {
"./js/.cache/type-filesystem"
);

let buf1;
let buf2;
let buf3;
let buf4;

await del([outputPath, fileSystemCacheDirectory]);

const compiler1 = webpack({
Expand All @@ -243,11 +248,8 @@ describe("TestCache", () => {
}

compiler1.close(() => {
console.log(
`"${fs
.readFileSync(path.resolve(outputPath, "main.css"))
.toString()}"`
);
buf1 = fs.readFileSync(path.resolve(outputPath, "main.js"));
buf2 = fs.readFileSync(path.resolve(outputPath, "main.css"));

expect(Object.keys(stats.compilation.assets).sort())
.toMatchInlineSnapshot(`
Expand Down Expand Up @@ -293,11 +295,11 @@ describe("TestCache", () => {
}

compiler2.close(() => {
console.log(
`"${fs
.readFileSync(path.resolve(outputPath, "main.css"))
.toString()}"`
);
buf3 = fs.readFileSync(path.resolve(outputPath, "main.js"));
buf4 = fs.readFileSync(path.resolve(outputPath, "main.css"));

console.log(buf1.equals(buf3));
console.log(buf2.equals(buf4));

expect(Object.keys(stats.compilation.assets).sort())
.toMatchInlineSnapshot(`
Expand Down

0 comments on commit b14dbb9

Please sign in to comment.