mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2025-01-03 03:46:37 +03:00
unify the puppeteer test scripts
This commit is contained in:
parent
0ed9380044
commit
fb8b19a6d8
15
Shakefile.hs
15
Shakefile.hs
@ -124,15 +124,12 @@ main = do
|
||||
cmd (WithStdout True) (FileStdout out) "./node_modules/.bin/prettier" "--check" jsFiles
|
||||
|
||||
"log/puppeteer-tests.txt" %> \out -> do
|
||||
percyToken <- getEnv "PERCY_TOKEN"
|
||||
case percyToken of
|
||||
Nothing -> do
|
||||
writeFileChanged out "PERCY_TOKEN not set, so skipping visual diff testing."
|
||||
need ["log/npm-install.txt", "log/public.txt"]
|
||||
cmd (WithStdout True) (FileStdout out) "script/puppeteer-tests-no-percy.sh"
|
||||
Just _ -> do
|
||||
need ["log/npm-install.txt", "log/public.txt"]
|
||||
cmd (WithStdout True) (FileStdout out) "script/puppeteer-tests-percy.sh"
|
||||
-- `getEnv` looks like a no-op, but it actually makes Shake pay
|
||||
-- attention to this variable so that if it changes this command will be
|
||||
-- re-run with the new token.
|
||||
getEnv "PERCY_TOKEN"
|
||||
need ["log/npm-install.txt", "log/public.txt"]
|
||||
cmd (WithStdout True) (FileStdout out) "script/puppeteer-tests.sh"
|
||||
|
||||
"log/forbidden-imports-report.txt" %> \out -> do
|
||||
need ["forbidden-imports.toml"]
|
||||
|
@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
env ONLYDOODAD=${1-default} npx mocha script/puppeteer-tests.js --timeout 25000 --exit
|
@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
env ONLYDOODAD=${1-default} npx percy exec -- mocha script/puppeteer-tests.js --timeout 100000 --exit
|
11
script/puppeteer-tests.sh
Executable file
11
script/puppeteer-tests.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
export ONLYDOODAD=${1:-default}
|
||||
|
||||
if test -n "${PERCY_TOKEN:-}"; then
|
||||
npx percy exec -- mocha script/puppeteer-tests.js --timeout 100000 --exit
|
||||
else
|
||||
echo "PERCY_TOKEN not set, so skipping visual diff testing."
|
||||
npx mocha script/puppeteer-tests.js --timeout 25000 --exit
|
||||
fi
|
Loading…
Reference in New Issue
Block a user