JSPM

  • Created
  • Published
  • Downloads 3415
  • Score
    100M100P100Q103834F
  • 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. Set up tests as thunks, then execute them with a call.

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

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')
  })()
// adds two values
//  ✓ (5, 5) -> 10
//  ✓ ('abcde', 'fg') -> callback(...)