Files
zkldi_Tachi/seeds/scripts/run-tests.sh
T
zk 593adb2717 feat: Dev Container (#1149)
* temporary dvctr

* start of work

* fix: timeouts in windows

* fish?

* feat: better, working stuff

* refactor: rename database-seeds to seeds/

* better

* fdsaf

* feat: don't let our container get owned by root

* fix: better user handling

* feat: falling asleep at my desk i yield to you what i have done

* feat: autoadminify

* docs: denote trickshot

* feat: open in browser on launch

* better seeds workings...

* fix: dont kill shell

* docs: mention dev/debs

* fix: whoops

* fix: make seeds load within the century

* feat: rest of the containerisation

* feat: new alias

* style: fix linter errors

* fix: bad call

* fix: better justfile
2024-08-17 15:01:40 +01:00

37 lines
678 B
Bash
Executable File

#!/bin/bash
cd "$(dirname "$0")" || exit 1
failed=()
function onFailure() {
failed+=( "$?" )
}
trap onFailure ERR
tests=(test/**.test.ts)
# for all tests
for test in "${tests[@]}"
do
# Output stderr and stdout to the terminal, but only save stderr to a file
# Isn't bash wonderful?
ts-node "$test" 2> >(tee failed-tests.log >&2)
done
# if more than 0 commands failed
if [ "${#failed[@]}" -ne 0 ]; then
# iterate through the error codes and zip them with their
# test equivalent
for (( i = 0; i < ${#failed[@]}; i++ ));
do
if [ "${failed[$i]}" -ne 0 ]; then
echo "Test ${tests[$i]} failed. exit code: ${failed[$i]}"
fi;
done
exit 1;
fi;
# success
exit 0;