From c678f1a1bdfad1f1bf9fb3a77a05b9a739df6c35 Mon Sep 17 00:00:00 2001 From: Sebastian Davids Date: Sat, 1 Feb 2025 20:01:13 +0100 Subject: [PATCH] chore: run e2e test in push commit hook Signed-off-by: Sebastian Davids --- hp/.husky/pre-push | 4 ++++ hp/playwright.config.mjs | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hp/.husky/pre-push b/hp/.husky/pre-push index 7568d8d..4795982 100755 --- a/hp/.husky/pre-push +++ b/hp/.husky/pre-push @@ -4,3 +4,7 @@ cd hp || exit 1 node --run test >&2 + +node --run build:dist:skip-install + +GIT_PUSH_HOOK=true node --run e2e diff --git a/hp/playwright.config.mjs b/hp/playwright.config.mjs index b7a08fb..628d2b4 100644 --- a/hp/playwright.config.mjs +++ b/hp/playwright.config.mjs @@ -40,13 +40,15 @@ let config = { ], }; -if (process.env.CI) { +const shouldStartWebServer = process.env.CI || process.env.GIT_PUSH_HOOK; + +if (shouldStartWebServer) { config = { ...config, webServer: { command: 'node --run start', url: 'http://127.0.0.1:3000', - reuseExistingServer: !process.env.CI, + reuseExistingServer: !shouldStartWebServer, }, }; }