Run tape tests written in Earl Grey

Usage no npm install needed!

<script type="module">
  import earltape from 'https://cdn.skypack.dev/earltape';



Run tape tests written in Earl Grey!

To install: npm install -g earltape

The command works exactly the same as the regular tape runner, just do earltape test/*.eg to run your tests. You can pipe earltape into any standard tap reporter as you would expect.

To write your tests, require('tape') and use it exactly like you would if you were writing your tests in javascript. You won't get the same API if you require earltape as the index file contains macros.


Instead of requiring tape, you can use the test macro:

require-macro: earltape -> test

test "timing test":
  @equal(typeof(Date.now), 'function')
  start = Date.now()

  setTimeout(cb, 100) where cb = ->
    @equal(Date.now() - start, 100)

Many thanks to hflw for Coffeetape.