Open Alex-Jongman opened 2 years ago
You can specify a port using --port
. You can run them together in the same bash script, but you still need a way to sync the ports.
Tried to use the life cycle of npm script by defining the scripts:
"prea11y": "web-dev-server --node-resolve --port 8000",
"a11y": "axe localhost:8000",
in the package.json.
But when I run npm run a11y
the pre script never finishes, because the web-dev-server doesn't finish until I hit Ctrl+C.
Also tried the npm package 'concurrently', but than the I got a timing problem, because the axe script already started before the web server was up.
Any suggestions on how I could setup the package.json to test with axe?
I want to add an accessibility test based on the axe linter to my package.json scripts. I installed axe with
npm install @axe-core/cli -g
and added the following lines to the package.json:The axe based test however requires the web server to be running on a specific port, and I wonder if it is possible to start the web server together with the accessibility test in a single script, and have axe automatically use the url and port of that web server.