Skip to content

Instantly share code, notes, and snippets.

@Krxtopher
Krxtopher / omit-callback-unit-test.js
Last active December 26, 2015 15:18 — forked from tobius/omit-callback-unit-test.js
Here's my simplified version of Toby's original solution. This solution takes advantage of Jasmine's built-in toThrow() matcher which is similar to matchers in the should.js, expect.js, and chai assertion libraries which all work with Mocha.
/*
The implementation below assumes you're using Jasmine's built-in matchers. But similar matchers
exist in the should.js, expect.js, and chai assertion libraries which work with Mocha.
*/
var makeSomething = function(callback) {
// Below is the simplest implementation that will result in the test passing.
// If you want a more robust implementation, you'll want to write more tests first. :)
throw(new Error("Missing parameters"));
};