Skip to content

Instantly share code, notes, and snippets.

@mutaimwiti
Created November 15, 2019 10:54
Show Gist options
  • Save mutaimwiti/f7a4c5b60bee8b9fc123608cc263146f to your computer and use it in GitHub Desktop.
Save mutaimwiti/f7a4c5b60bee8b9fc123608cc263146f to your computer and use it in GitHub Desktop.
supertest-scenario-3
const request = require('supertest');
const request = supertest(app);
describe('Articles', function () {
it('should allow users to list all articles', function (done) {
request
.get('/articles')
.set('authorization', generateAuthToken())
.expect(200, done)
});
it('should allow users to get one article', function (done) {
request
.get('/articles/2')
.set('authorization', generateAuthToken())
.expect(200, done)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment