Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
API Testing Example - Part 1
describe('Authentication', function() {
it('errors if wrong basic auth', function(done) {
.set('x-api-key', '123myapikey')
.auth('incorrect', 'credentials')
.expect(401, done)
it('errors if bad x-api-key header', function(done) {
.auth('correct', 'credentials')
.expect({error:"Bad or missing app identification header"}, done);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.