Created
May 16, 2011 00:38
-
-
Save JerrySievert/973725 to your computer and use it in GitHub Desktop.
test for jsdom src attribute
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
env_with_src : function() { | |
var | |
html = "<html><body><p>hello world!</p></body></html>", | |
src = "window.attachedHere = 123"; | |
jsdom.env({ | |
html : html, | |
src : src, | |
done : function(errors, window) { | |
assertNull("error should not be null", errors); | |
assertNotNull("window should be valid", window.location); | |
assertEquals("script should execute on our window", window.attachedHere, 123); | |
assertEquals("anchor text", window.document.getElementsByTagName("a").item(0).innerHTML, 'World'); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment