Last active
November 27, 2019 08:08
-
-
Save mutaimwiti/ff0d41a7e5d2eae0a774abe64197f2a3 to your computer and use it in GitHub Desktop.
Using wrapper es6
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
// test/article.spec.js | |
import app from './testUtils/app'; | |
describe('Articles', () => { | |
describe('GET', () => { | |
it('should not allow unauthenticated users to list all articles', async () => { | |
const res = await app.get('/articles'); | |
expect(res.status).toBe(401); | |
}); | |
it('should allow authenticated users to list all articles', async () => { | |
await app.loginRandom(); | |
const { body } = await app.get('/articles'); | |
expect(body.articles).toEqual('All articles'); | |
app.logout(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment