mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2025-01-05 05:07:06 +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
|
cmd (WithStdout True) (FileStdout out) "./node_modules/.bin/prettier" "--check" jsFiles
|
||||||
|
|
||||||
"log/puppeteer-tests.txt" %> \out -> do
|
"log/puppeteer-tests.txt" %> \out -> do
|
||||||
percyToken <- getEnv "PERCY_TOKEN"
|
-- `getEnv` looks like a no-op, but it actually makes Shake pay
|
||||||
case percyToken of
|
-- attention to this variable so that if it changes this command will be
|
||||||
Nothing -> do
|
-- re-run with the new token.
|
||||||
writeFileChanged out "PERCY_TOKEN not set, so skipping visual diff testing."
|
getEnv "PERCY_TOKEN"
|
||||||
need ["log/npm-install.txt", "log/public.txt"]
|
need ["log/npm-install.txt", "log/public.txt"]
|
||||||
cmd (WithStdout True) (FileStdout out) "script/puppeteer-tests-no-percy.sh"
|
cmd (WithStdout True) (FileStdout out) "script/puppeteer-tests.sh"
|
||||||
Just _ -> do
|
|
||||||
need ["log/npm-install.txt", "log/public.txt"]
|
|
||||||
cmd (WithStdout True) (FileStdout out) "script/puppeteer-tests-percy.sh"
|
|
||||||
|
|
||||||
"log/forbidden-imports-report.txt" %> \out -> do
|
"log/forbidden-imports-report.txt" %> \out -> do
|
||||||
need ["forbidden-imports.toml"]
|
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