Skip to content

Commit 385a3e5

Browse files
committed
Fix the still broken test
1 parent d80cf63 commit 385a3e5

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

lib/buildtools/src/build/modules/__tests__/building.test.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,16 @@ test('build manifest', async () => {
125125
await buildManifest(sampleManifests, outDir);
126126

127127
expect(fs.mkdir).toHaveBeenCalledExactlyOnceWith(outDir);
128-
expect(fs.writeFile).toHaveBeenCalledExactlyOnceWith(
129-
`${outDir}/modules.json`,
130-
JSON.stringify({
131-
bundle0: {
132-
requires: 1
133-
},
134-
bundle1: {
135-
version: '1.0.0'
136-
}
137-
})
138-
);
128+
expect(fs.writeFile).toHaveBeenCalledOnce();
129+
const [[path, output]] = vi.mocked(fs.writeFile).mock.calls;
130+
131+
expect(path).toEqual(`${outDir}/modules.json`);
132+
expect(JSON.parse(output as string)).toMatchObject({
133+
bundle0: {
134+
requires: 1
135+
},
136+
bundle1: {
137+
version: '1.0.0'
138+
}
139+
});
139140
});

0 commit comments

Comments
 (0)