1.0.5 • Published 7 years ago

mockeasy v1.0.5

Weekly downloads
178
License
MIT
Repository
github
Last release
7 years ago

MockEasy

MockEasy is a simple yet powerful mocking library for NodeJS.

A good use case for this library is mocking data access objects in tests, negating the use of a database.

Example

// math.js
exports.increment = function(value) {
  return value++;
}
// test.js
const mockeasy = require('mockeasy');
const mockedMath = mockeasy.stub(require('./math'));

mockedMath.increment.once(function(value) {
  return 100;
});

console.log(mockedMath.increment());
// 100

console.log(mockedMath.increment());
// throws error
1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago