feat: make e2e start dev server automatically

This commit is contained in:
Phan An 2020-12-30 11:11:08 +01:00
parent 0fd84fa212
commit d29a2dcf39
4 changed files with 24 additions and 5 deletions

View file

@ -61,6 +61,8 @@ yarn type-check # TypeScript type checking
yarn test # Unit testing
```
> Note: If you're already running `yarn test:e2e`, there's no need to start a dev server. `yarn test:e2e` calls `yarn dev` internally and will eliminate the existing `yarn-dev` process, if any.
> A quick and easy way to start hacking on koel is to open and run this repo in Gitpod, an online IDE with full Laravel support.
>
> [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/koel/koel)

View file

@ -1,5 +1,5 @@
{
"baseUrl": "http://localhost:8088",
"baseUrl": "http://localhost:8080",
"pluginsFile": "cypress/plugins/index.ts",
"viewportWidth": 1440,
"viewportHeight": 768,

View file

@ -19,6 +19,7 @@
"cypress": "^6.2.0",
"font-awesome": "^4.7.0",
"husky": "^4.2.5",
"kill-port": "^1.6.1",
"laravel-mix": "^5.0.4",
"lint-staged": "^10.3.0",
"resolve-url-loader": "^3.1.1",
@ -36,10 +37,8 @@
"watch-poll": "yarn watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"dev": "start-test 'php artisan serve --port=8000 --quiet' :8000 hot",
"test:e2e": "start-test 'php artisan serve --port=8088 --quiet' :8088 'cypress open'",
"test:e2e:ci": "start-test 'php artisan serve --port=8088 --quiet' :8088 'cypress run'",
"test:e2e": "kill-port 8080 && start-test dev :8080 'cypress open'",
"test:e2e:ci": "kill-port 8080 && start-test 'php artisan serve --port=8080 --quiet' :8080 'cypress run'",
"build": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"build-demo": "cross-env NODE_ENV=demo node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},

View file

@ -3917,6 +3917,11 @@ get-stream@^5.0.0:
dependencies:
pump "^3.0.0"
get-them-args@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/get-them-args/-/get-them-args-1.3.2.tgz#74a20ba8a4abece5ae199ad03f2bcc68fdfc9ba5"
integrity sha1-dKILqKSr7OWuGZrQPyvMaP38m6U=
get-value@^2.0.3, get-value@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
@ -5005,6 +5010,14 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.10.0"
kill-port@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/kill-port/-/kill-port-1.6.1.tgz#560fe79484583bdf3a5e908557dae614447618aa"
integrity sha512-un0Y55cOM7JKGaLnGja28T38tDDop0AQ8N0KlAdyh+B1nmMoX8AnNmqPNZbS3mUMgiST51DCVqmbFT1gNJpVNw==
dependencies:
get-them-args "1.3.2"
shell-exec "1.0.2"
killable@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892"
@ -7551,6 +7564,11 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
shell-exec@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/shell-exec/-/shell-exec-1.0.2.tgz#2e9361b0fde1d73f476c4b6671fa17785f696756"
integrity sha512-jyVd+kU2X+mWKMmGhx4fpWbPsjvD53k9ivqetutVW/BQ+WIZoDoP4d8vUMGezV6saZsiNoW2f9GIhg9Dondohg==
shellwords@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"