JSPM

  • Created
  • Published
  • Downloads 3415
  • Score
    100M100P100Q103626F
  • License MIT

Modular testing for JavaScript

Package Exports

  • thunk-test

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (thunk-test) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ThunkTest

Modular testing for JavaScript

const add = (a, b) => a + b

const thunkTestForAdd = ThunkTest('adds two values', add)
  .case(5, 5, 10) // assert.strictEqual(add(5, 5), 10)
  .case('abcde', 'fg', result => { // supply your own callback
    assert.strictEqual(result, 'abcdefg')
  })

thunkTestForAdd()
// adds two values
//  ✓ (5, 5) -> 10
//  ✓ (abcde, fg) -> callback(...)