An example on how to write asynchronous tests using async/await (thanks babel :D) and tape.
Spoiler: tests and code are written in ES6/7 :). Spoiler 2: you can also use this with other testing frameworks ;).
For more on async/await, read Taming the asynchronous beast with ES7 from Nolan Watson, it's an amazing write up on the subject!
For more on tape, see the main repo and this (perhaps very opinionated) blog post.
Here's a little bash script to run multiple test files:
#!/usr/bin/env bash
where=${1:-.}
tests=$1
if [ -d $where ]; then
tests=`find $where -type f -name '*-test.*' -not -path './node_modules/*'`
fi
for test in $tests; do
./node_modules/.bin/babel-node $2 $test
done
You can also use tape's CLI.
MIT license.
With <3 by UXtemple.