Skip to content

Commit 1d0f9f5

Browse files
committed
test: tweak tests to try and pass on windows
1 parent a4b5c8e commit 1d0f9f5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/tools/screenshot.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ describe('screenshot', () => {
171171

172172
it('with malformed filePath', async () => {
173173
await withBrowser(async (response, context) => {
174-
const filePath = 'malformed\0path.png';
174+
// Use a platform-specific invalid character.
175+
// On Windows, characters like '<', '>', ':', '"', '/', '\', '|', '?', '*' are invalid.
176+
// On POSIX, the null byte is invalid.
177+
const invalidChar = process.platform === 'win32' ? '>' : '\0';
178+
const filePath = `malformed${invalidChar}path.png`;
175179
const fixture = screenshots.basic;
176180
const page = context.getSelectedPage();
177181
await page.setContent(fixture.html);

0 commit comments

Comments
 (0)