Skip to content

Commit

Permalink
chore: run e2e test in push commit hook
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Davids <[email protected]>
  • Loading branch information
sdavids committed Feb 1, 2025
1 parent 50715a5 commit c678f1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions hp/.husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions hp/playwright.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};
}
Expand Down

0 comments on commit c678f1a

Please sign in to comment.