diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..a7f95a9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# The vendored Playwright client is verified by a byte-exact SHA-256 digest +# (scripts/build-playwright-sandbox-client.mjs), and the generated bundle is +# byte-compared against a fresh esbuild output. Both must therefore check out +# identically on every platform, regardless of core.autocrlf. +src/browser/run/playwright-client/vendor/** text eol=lf +src/browser/run/generated/playwright-client.js text eol=lf diff --git a/scripts/build-playwright-sandbox-client.mjs b/scripts/build-playwright-sandbox-client.mjs index 4e58a16..46b6ab2 100644 --- a/scripts/build-playwright-sandbox-client.mjs +++ b/scripts/build-playwright-sandbox-client.mjs @@ -1,7 +1,7 @@ import { createHash } from 'node:crypto'; import { mkdtemp, readFile, readdir, rm } from 'node:fs/promises'; import { tmpdir } from 'node:os'; -import { join } from 'node:path'; +import { join, sep } from 'node:path'; import { build } from 'esbuild'; const output = 'src/browser/run/generated/playwright-client.js'; @@ -24,7 +24,7 @@ async function vendorDigest(directory) { await walk(directory); const hash = createHash('sha256'); for (const file of files.sort()) { - const entry = file.slice(directory.length + 1); + const entry = file.slice(directory.length + 1).split(sep).join('/'); hash.update(entry); hash.update('\0'); hash.update(await readFile(file)); diff --git a/vitest.config.ts b/vitest.config.ts index 45b8347..8a7df98 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -23,7 +23,6 @@ export default defineConfig({ test: { name: 'unit', include: ['src/**/*.test.ts'], - exclude: ['src/browser/**/*.test.ts'], sequence: { groupOrder: 0 }, }, },