Skip to content

Commit f79606a

Browse files
authored
test: sort globbed images before comparing with snapshots (#373)
1 parent 7a57033 commit f79606a

File tree

4 files changed

+2
-2
lines changed

4 files changed

+2
-2
lines changed
-126 KB
Loading
125 KB
Loading

test/integration/prerender-app.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('prerender', () => {
2323
// use globby and fs tools to read the images
2424
const imagePath = resolve('../fixtures/app-dir/.output/public/__og-image__')
2525
// globby in image path
26-
const images = await globby('**/*.png', { cwd: imagePath })
26+
const images = await globby('**/*.png', { cwd: imagePath }).then(r => r.sort())
2727
// for each image we run a snapshot test
2828
for (const image of images) {
2929
const imageBuffer = await fs.readFile(resolve(imagePath, image))

test/integration/zeroRuntimeBuild.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('zeroRuntime', () => {
2828
console.log(`Size: ${stdout.split(' ')[0]}`)
2929
const imagePath = resolve('../fixtures/zero-runtime/.output/public/__og-image__')
3030
// globby in image path
31-
const images = await globby('**/*.png', { cwd: imagePath })
31+
const images = await globby('**/*.png', { cwd: imagePath }).then(r => r.sort())
3232
// for each image we run a snapshot test
3333
for (const image of images) {
3434
const imageBuffer = await fs.readFile(resolve(imagePath, image))

0 commit comments

Comments
 (0)