Created
February 3, 2015 05:42
-
-
Save pscollins/9b1b41ed424820257712 to your computer and use it in GitHub Desktop.
Bad test?
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
vows = require 'vows' | |
assert = require 'assert' | |
phantom = require '../phantom' | |
describe = (name, bat) -> vows.describe(name).addBatch(bat).export(module) | |
# Make coffeescript not return anything | |
# This is needed because vows topics do different things if you have a return value | |
t = (fn) -> | |
-> | |
fn.apply this, arguments | |
return | |
describe "The phantom module (error behavior)", | |
"Cannot create an instance at a nonexistent path": | |
topic: t -> | |
phantom.create {port: 12302}, (ph, err) => | |
console.log "CREATED" | |
@callback null, [ph, err] | |
"which is null": ([ph, err]) -> | |
assert.isNull ph | |
"which returned an error": ([ph, err]) -> | |
assert.isObject err | |
"with an error code of ENOENT": ([ph, err]) -> | |
assert.strictEqual err?.code, "ENOENT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment