mirror of
https://github.com/ilyakooo0/purescript-spec-mocha.git
synced 2024-11-22 02:32:08 +03:00
30 lines
523 B
Bash
Executable File
30 lines
523 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
mkdir -p output
|
|
pulp browserify -I test --main Test.Main --to output/bundle.js
|
|
|
|
$(mocha output/bundle.js > output/test-output.txt) || echo "Checking test output..."
|
|
|
|
fail() {
|
|
echo -e "\nTests output:\n"
|
|
cat output/test-output.txt
|
|
exit 1
|
|
}
|
|
|
|
test_single() {
|
|
str="$1"
|
|
echo -n "${str}? "
|
|
if ! grep -q "$str" output/test-output.txt; then
|
|
echo "Nope."
|
|
fail
|
|
else
|
|
echo "Yes!"
|
|
fi
|
|
}
|
|
|
|
test_single "2 passing"
|
|
test_single "1 pending"
|
|
test_single "2 failing"
|