UNPKG

nodeunit-mock

Version:

A helper to allow you to mock out methods in a single nodeunit test without affecting the rest of the tests.

14 lines (10 loc) 320 B
"use strict"; var mock = require(".."); var SanityTests = module.exports; SanityTests["Cannot Mock Undefined"] = function(test) { var obj = {}; test.throws(function() { mock(test, obj.myProperty, "myFunction"); }, Error, "Attempting to mock function myFunction of undefined."); test.done(); }