Created
July 28, 2014 06:52
-
-
Save ariya/ec0509924278709de977 to your computer and use it in GitHub Desktop.
Sample test for PhantomJS 2
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
typeof phantom is object | |
typeof phantom.version is object | |
typeof phantom.args is object | |
typeof phantom.args.length is number | |
typeof phantom.scriptName is string | |
typeof phantom.exit is function | |
phantom.version.major is 2 | |
phantom.version.minor is 0 | |
phantom.version.patch is 0 |
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
function assert(msg, actual, expected) { | |
if (actual == expected) { | |
console.log(msg, actual); | |
} else { | |
console.log(msg, actual, ' -> FAIL: expecting', expected); | |
} | |
} | |
assert('typeof phantom is', typeof phantom, 'object'); | |
assert('typeof phantom.version is', typeof phantom.version, 'object'); | |
assert('typeof phantom.args is', typeof phantom.args, 'object'); | |
assert('typeof phantom.args.length is', typeof phantom.args.length, 'number'); | |
assert('typeof phantom.scriptName is', typeof phantom.scriptName, 'string'); | |
assert('typeof phantom.exit is', typeof phantom.exit, 'function'); | |
assert('phantom.version.major is', phantom.version.major, 2); | |
assert('phantom.version.minor is', phantom.version.minor, 0); | |
assert('phantom.version.patch is', phantom.version.patch, 0); | |
phantom.exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment