You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using jasmine-node to test a REST API. My problem is that when a request errors out or something unexpected happens, I always get Javascript TypeErrors because I'm testing properties on object's that are null and the test process never terminates (it just hangs there after encountering the first TypeError error).
For example:
it('should get resource',function(done){client.get('/some/resouce',function(error,res){expect(error).toBeFalsy();expect(res.status).toBe(200);done();}}
The above code will return an error message TypeError: Cannot read property 'status' of undefined if there is an error and jasmine-node just hangs there and never gives me a test report.
I use the following command to run tests: ./node_modules/.bin/jasmine-node test/ --verbose --autotest --captureExceptions --color --watch ./server
Is there any way to avoid those errors?
The text was updated successfully, but these errors were encountered:
it('should get resource',function(done){client.get('/some/resouce',function(error,res){if(error)returndone(error);expect(res.status).toBe(200);done();}}
I'm using jasmine-node to test a REST API. My problem is that when a request errors out or something unexpected happens, I always get Javascript TypeErrors because I'm testing properties on object's that are null and the test process never terminates (it just hangs there after encountering the first TypeError error).
For example:
The above code will return an error message
TypeError: Cannot read property 'status' of undefined
if there is an error and jasmine-node just hangs there and never gives me a test report.I use the following command to run tests:
./node_modules/.bin/jasmine-node test/ --verbose --autotest --captureExceptions --color --watch ./server
Is there any way to avoid those errors?
The text was updated successfully, but these errors were encountered: