mocha-let

0.1.1 • Public • Published

mocha-let Build Status

A dead-simple package that lets you create RSpec-style memoized values in Mocha.

The entire package is just 25 lines of code, with only one dependency (memoizee). See for yourself!

Basic usage

var set = require('mocha-let');
var assert = require('assert');
 
describe('mocha-let', function() {
  var object = {};
  set('object', function() { return object; });
 
  it("allows accessing the return value of the given function as the specified property on `this`", function() {
    assert.equal(this.object, object);
  });
});

For a more complete example, have a look at test.js.

License

MIT (See LICENSE file)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    13
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    13
  • 0.1.0
    1

Package Sidebar

Install

npm i mocha-let

Weekly Downloads

14

Version

0.1.1

License

MIT

Last publish

Collaborators

  • ajedi32