Skip to content

Instantly share code, notes, and snippets.

@mutaimwiti
Last active November 27, 2019 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mutaimwiti/224a92671e6f1d5dc366157be513ace2 to your computer and use it in GitHub Desktop.
Save mutaimwiti/224a92671e6f1d5dc366157be513ace2 to your computer and use it in GitHub Desktop.
Using wrapper es5
// test/article.spec.js
var app = require('./testUtils/app');
describe('Articles', function() {
describe('GET', function() {
it('should not allow unauthenticated users to list all articles', function(done) {
app.get('/articles').expect(401, done);
});
it('should allow authenticated users to list all articles', function(done) {
app.loginRandom(function() {
app.get('/articles').then(function(res) {
expect(res.body.articles).toEqual('All articles');
app.logout();
done();
});
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment