Prepare repo for open source

This commit is contained in:
Samraaj Bath
2026-06-29 16:14:44 -07:00
parent 66dfdcc58d
commit 3f7c9ed227
28 changed files with 1461 additions and 574 deletions
+12
View File
@@ -2,6 +2,18 @@
"name": "@cloner/test-utils",
"version": "0.1.0",
"private": true,
"description": "Shared fixture server and integration-test helpers for ditto.site workspaces.",
"license": "MIT",
"author": "ion-design",
"repository": {
"type": "git",
"url": "https://github.com/ion-design/ditto.site.git",
"directory": "packages/test-utils"
},
"bugs": {
"url": "https://github.com/ion-design/ditto.site/issues"
},
"homepage": "https://github.com/ion-design/ditto.site#readme",
"type": "module",
"exports": {
".": "./src/index.ts"
+8 -3
View File
@@ -78,9 +78,14 @@ export function serveDir(rootDir: string): Promise<{ url: string; close: () => P
/** Whether a Playwright Chromium browser appears installed (browser tests skip if not). */
export function hasChromium(): boolean {
try {
const base = process.env.PLAYWRIGHT_BROWSERS_PATH || join(homedir(), ".cache", "ms-playwright");
if (!existsSync(base)) return false;
return readdirSync(base).some((d) => d.startsWith("chromium"));
const bases = process.env.PLAYWRIGHT_BROWSERS_PATH
? [process.env.PLAYWRIGHT_BROWSERS_PATH]
: [
join(homedir(), ".cache", "ms-playwright"),
join(homedir(), "Library", "Caches", "ms-playwright"),
...(process.env.LOCALAPPDATA ? [join(process.env.LOCALAPPDATA, "ms-playwright")] : []),
];
return bases.some((base) => existsSync(base) && readdirSync(base).some((d) => d.startsWith("chromium")));
} catch {
return false;
}