Skip to content

Instantly share code, notes, and snippets.

@OscarGodson
Created August 26, 2014 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OscarGodson/0f9d78e91415cd2e34f6 to your computer and use it in GitHub Desktop.
Save OscarGodson/0f9d78e91415cd2e34f6 to your computer and use it in GitHub Desktop.
var Foo = require('../foo/index.js');
var someClass = new SomeClass({
someMethod: function () {
// How do I stub this without requiring it to be set on the prototype?
// ex: w/o having it set on someClass.baz = Foo.bar();
var baz = Foo.bar();
if (baz == 'hello') {
return 1
}
else {
return 0
}
}
});
@jmreidy
Copy link

jmreidy commented Aug 26, 2014

Note that the karma example above is relying on a key karma plugin, or at least my fork of it: https://github.com/jmreidy/karma-browserifast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment