Created
May 16, 2014 17:47
-
-
Save jeffmo/f58d6147213c87ceae4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('This is a test', function() { | |
it('is only a test', function() { | |
var SomeEmitter = require('../SomeEmitter'); | |
var emitter = new SomeEmitter; | |
emitter.on('foo').emit('bar'); | |
expect(emitter.on).toBeCalledWith('foo'); | |
expect(emitter.emit).toBeCalledWith('bar'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SomeEmitter = require.generateMock('../SomeEmitter'); | |
SomeEmitter.prototype.on.mockReturnThis(); | |
SomeEmitter.prototype.emit.mockReturnThis(); | |
module.exports = SomeEmitter; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment