Skip to content

Instantly share code, notes, and snippets.

@lightsofapollo
Created June 22, 2017 16:51
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 lightsofapollo/7a6c926e52ab67409125361fb912aa66 to your computer and use it in GitHub Desktop.
Save lightsofapollo/7a6c926e52ab67409125361fb912aa66 to your computer and use it in GitHub Desktop.
it('gets a route but is not authed', (done) => {
chai.request(server)
.get('/')
.end((err, res) => {
assert(res.request.url.endsWith('/login'),
'should be redirected to /login');
done();
});
});
it('gets a route but is not authed', async () => {
const res = await request(server).get('/').end();
assert(res.request.url.endsWith('/login'), 'should be redirected to /login');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment