Created
April 24, 2014 18:49
-
-
Save ingoe/11265248 to your computer and use it in GitHub Desktop.
window addEventHandler test
This file contains hidden or 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('window.postMessage test', function() { | |
var o; | |
beforeEach(function(done) { | |
o = { | |
f: function() {} | |
}; | |
// won't pass the spec | |
// window.addEventListener('message', o.f, false); | |
spyOn(o, 'f').and.callFake(function() { | |
done(); | |
}); | |
// will pass the spec | |
window.addEventListener('message', o.f, false); | |
window.postMessage('another bam', '*'); | |
}); | |
it('works...', function() { | |
expect(o.f).toHaveBeenCalled(); | |
}); | |
}); |
Author
ingoe
commented
Apr 28, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment