mirror of
https://github.com/ilyakooo0/purescript-spec-mocha.git
synced 2024-11-22 10:52:13 +03:00
Add test runner script with proper checking
This commit is contained in:
parent
740064f182
commit
948c6c163e
@ -46,6 +46,12 @@ If you have any issues or possible improvements please file them as
|
|||||||
[GitHub Issues](https://github.com/owickstrom/purescript-spec-mocha/issues).
|
[GitHub Issues](https://github.com/owickstrom/purescript-spec-mocha/issues).
|
||||||
Pull requests requests are encouraged.
|
Pull requests requests are encouraged.
|
||||||
|
|
||||||
|
### Running Tests
|
||||||
|
|
||||||
|
This project's tests include some failures to test the Mocha
|
||||||
|
integration. Thus, use `run_tests.sh` instead of `pulp test` to check
|
||||||
|
that everything is all right.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT License](LICENSE.md).
|
[MIT License](LICENSE.md).
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
pulp browserify -I test --main Test.Main > output/bundle.js
|
|
||||||
mocha output/bundle.js
|
|
29
run_tests.sh
Executable file
29
run_tests.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/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"
|
Loading…
Reference in New Issue
Block a user