-
-
Save theycallmeswift/1233801 to your computer and use it in GitHub Desktop.
# So, I have a feature file like the following that is designed to | |
# check that the error routes (404 & 500) are working as expected. | |
{Feature} = require 'vows-bdd' | |
assert = require 'assert' | |
vows = require 'vows' | |
zombie = require 'zombie' | |
server = require '../server' | |
Feature("As a visitor, I can view pages on the website", module) | |
.scenario("As a visitor, I attempt to view a missing page") | |
.given "the server is running", -> | |
server.listen server.port, @callback() | |
.and "the following route that results in a 404 exist", -> | |
server.get('/404', (req, res, next) -> | |
next() | |
) | |
@callback() | |
.when "I visit a page that results in a 404 error", -> | |
zombie.visit "http://localhost:#{server.port}/404", @callback | |
.then "I should recieve an error", (err, browser, status) -> | |
assert.isNotNull err | |
assert.match err.message, /got 404/ | |
.and "the page should respond with a status code of 404", (err, browser, status) -> | |
assert.equal err.response.statusCode, 404 | |
.complete -> | |
server.close() | |
.scenario("As a visitor, I attempt to view a page that causes an error") | |
.given "the server is running", -> | |
server.listen server.port, @callback() | |
.and "the following route that results in a 500 error exist", -> | |
server.get('/500', (req, res, next) -> | |
next(500) | |
) | |
@callback() | |
.when "I visit a page that results in a 500 error", -> | |
zombie.visit "http://localhost:#{server.port}/500", @callback | |
.then "I should recieve an error", (err, browser, status) -> | |
assert.isNotNull err | |
assert.match err.message, /got 500/ | |
.and "the page should respond with a status code of 500", (err, browser, status) -> | |
assert.equal err.response.statusCode, 500 | |
.complete -> | |
server.close() | |
.finish module |
[ theycallmeswift ~/dev/personal/blah master ✔ ] NODE_ENV=test coffee features/visitor_views_the_website.coffee | |
error: Loading resource: Could not load resource at http://localhost:3000/404, got 404 - More: | |
Error: Could not load resource at http://localhost:3000/404, got 404 | |
·· error: Loading resource: Could not load resource at http://localhost:3000/500, got 500 - More: | |
Error: Could not load resource at http://localhost:3000/500, got 500 | |
·· ✓ OK » 4 honored (0.050s) | |
How can I get rid of those error messages ^^^^ |
Traced it back to the resources.js file, line 312. There the error is passed to a callback but there are so many callbacks floating around there that I can't see where the message is actually console.log'ged. Commenting the "return" line helps though, but I don't know if it breaks something else in the process...
Nothing. Nobody from Zombie ever got back to me
I opened up an official issue on the zombie github page yesterday, linking to your gist. Let's see if it helps. Testing REST-Interfaces with that "error" in place is annoying at best...
Thanks. Keep me posted on what you get back
Have you ever tried 'debug:false' option?
browser = new zombie.Browser({debug:false})
Course. I even identified the line in the code that does this console.log (see above, rosources.js, line 312) and it is not limited by anything...
I overlooked it.
My bad.
Any updates on solving this?
According to the developer this is fixed in the latest release. Anyone tried it yet?
I tried. Still no luck.
Totally second that. Have looked on Google forever to solve this. Any results so far?