Created
October 2, 2012 17:47
-
-
Save brianflurry/3821607 to your computer and use it in GitHub Desktop.
Hello World Mocha regression 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
// init the test client | |
var client = restify.createJsonClient({ | |
version: '*', | |
url: 'http://127.0.0.1:8080' | |
}); | |
describe('service: hello', function() { | |
// Test #1 | |
describe('200 response check', function() { | |
it('should get a 200 response', function(done) { | |
client.get('/hello/world', function(err, req, res, data) { | |
if (err) { | |
throw new Error(err); | |
} | |
else { | |
if (data.code != 200) { | |
throw new Error('invalid response from /hello/world'); | |
} | |
done(); | |
} | |
}); | |
}); | |
}); | |
// Add more tests as needed... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment