wip(storybook): run storybook in nix derivation

This commit is contained in:
Brian McGee
2025-10-01 10:48:53 +01:00
committed by Glen Huang
parent fc4c9287cb
commit ec269a48f3
4 changed files with 48 additions and 39 deletions

View File

@@ -16,9 +16,9 @@
"knip": "knip --fix",
"storybook-build": "storybook build",
"storybook-dev": "storybook dev -p 6006",
"test-storybook": "vitest run --project storybook",
"test-storybook": "vitest run --project storybook --reporter verbose",
"test-storybook-update-snapshots": "vitest run --project storybook --update",
"test-storybook-static": "npm run storybook-build && concurrently -k -s first -n 'SB,TEST' -c 'magenta,blue' 'http-server storybook-static --port 6006 --silent' 'wait-on tcp:127.0.0.1:6006 && npm run test-storybook'"
"test-storybook-static": "npm run storybook-build && concurrently -k -s first -n 'SB,TEST' -c 'magenta,blue' 'http-server storybook-static -a 127.0.0.1 -p 6006 --silent' 'wait-on tcp:127.0.0.1:6006 && npm run test-storybook'"
},
"license": "MIT",
"devDependencies": {

View File

@@ -13,6 +13,8 @@ const dirname =
import viteConfig from "./vite.config";
const browser = process.env.BROWSER || "chromium";
export default mergeConfig(
viteConfig,
defineConfig({
@@ -42,9 +44,10 @@ export default mergeConfig(
provider: "playwright",
instances: [
{
browser: "webkit",
browser: "chromium",
launch: {
executablePath: process.env.PLAYWRIGHT_WEBKIT_EXECUTABLE,
// we specify this explicitly to avoid the version matching that playwright tries to do
executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE,
},
},
],