Skip to content

Instantly share code, notes, and snippets.

@andyperlitch
Created July 9, 2013 01:51
Show Gist options
  • Save andyperlitch/5954042 to your computer and use it in GitHub Desktop.
Save andyperlitch/5954042 to your computer and use it in GitHub Desktop.
exports = module.exports = function() {
return "hello";
}
exports = module.exports = function() {
return "mock hello";
}
var assert = require('assert');
var moduleA = require('./moduleA');
describe('moduleA', function() {
it('should return "hello"', function() {
assert.ok(moduleA() === "hello");
});
})
var moduleA = require('./moduleA');
exports = module.exports = function() {
return moduleA();
}
var assert = require('assert');
var moduleB = require('./moduleB');
describe('moduleB', function() {
it('should return whatever A returns', function() {
assert.ok(moduleB() === "hello");
});
})
require('./moduleA.spec');
require('./moduleB.spec');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment