Skip to content

An example on how to write asynchronous tests using async/await (thanks babel :D) and tape

Notifications You must be signed in to change notification settings

nolanlawson/async-await-tape-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Async/await tape example

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 ;).

Build Status

The code

Stuff to read

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.

Some helpers

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.

About

An example on how to write asynchronous tests using async/await (thanks babel :D) and tape

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%