node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »


betamax Flattr this!experimental

Automate the copying/removing of temporary directories for your tape tests.



betamax(directory[, test])

Where directory is the directory you want to copy to a temporary folder for each test. Returns a test decorator that will handle creating and removing the temporary directories as required:

var betamax = require('betamax')
var test = require('tape')
var basic = betamax(
  __diraname + '/fixtures/basic'
test('basic', basic(function(t) {
  // The temporary directory is set 
  // as a property on `t`: 
  var directory =

You might find it simpler to supply betamax with tape's test function, which will give you back a modified version to construct your tests with:

var betamax = require('betamax')
var tape = require('tape')
var test = betamax(
  __dirname + '/fixtures/basic'
, tape)
// You can pass tape's `test` method into 
// betamax to use it directly: 
test('basic', function(t) {
  var directory =
  // test things here... 


MIT. See for details.