Skip to content

Commit 5e4d7f2

Browse files
ijjkTimer
authored andcommitted
Fix backslashes in stats causing tests to fail on windows (#8505)
1 parent f81b6d5 commit 5e4d7f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/integration/chunking/test/index.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ describe('Chunking', () => {
3030
// Error here means old chunks don't exist, so we don't need to do anything
3131
}
3232
await nextBuild(appDir)
33-
stats = await readFile(join(appDir, '.next', 'stats.json'), 'utf8')
33+
stats = (await readFile(join(appDir, '.next', 'stats.json'), 'utf8'))
34+
// fixes backslashes in keyNames not being escaped on windows
35+
.replace(/"static\\(.*?":)/g, '"static\\\\$1')
36+
.replace(/("static\\.*?)\\pages\\(.*?":)/g, '$1\\\\pages\\\\$2')
37+
3438
stats = JSON.parse(stats)
3539
buildId = await readFile(join(appDir, '.next/BUILD_ID'), 'utf8')
3640
chunks = await readdir(join(appDir, '.next', 'static', 'chunks'))

0 commit comments

Comments
 (0)