Tape (JavaScript testing framework)

{{ Infobox Software | name = Tape | logo = Tape (JavaScript testing framework) Logo.svg | screenshot = | caption = | developer = James Halliday aka substack | released = | status = ACTIVE | latest release version = 4.6.2 | latest release date = 2016-09-30 | latest PREview version = | latest preview date = | operating system = Cross-platform | programming language = JavaScript | genre = Unit Test | license = MIT License | website = https://github.com/substack/tape }}

Tape is a tap-producing test harness for node and browsers requiring few APIs It can be used for unit and integration testing. Tests are code. So, you can run tests as modules with node

Usage

Example of a passing test.

import test from 'tape';

test('A passing test', (assert) => {

  assert.pass('This test will pass.');

  assert.end();
});

test('Assertions with tape.', (assert) => {
  const expected = 'something to test';
  const actual = 'sonething to test';

  assert.equal(actual, expected,
    'Given two mismatched values, .equal() should produce a nice bug report');

  assert.end();
});

See also

  • List of unit testing frameworks
  • List of JavaScript libraries
  • Test Anything Protocol