Created
January 18, 2019 03:02
-
-
Save sgml/6e616532814369e9fcf17da2b5372dff to your computer and use it in GitHub Desktop.
AutoSpy
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 spy = 'window.releaseEvents()'.replace(/^/,"spyOn(").replace(/\.([a-zA-Z]+)/, ", '$1'").replace(/[(][)]+$/,')'); | |
var expect = 'window.releaseEvents()'.replace(/^/, "expect('").replace(/[(][)]+/, '').replace(/$/,"').toHaveBeenCalled()") | |
console.log('spy: ' + spy); | |
console.log('expect: ' + expect); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment