changes to testing from last session
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
export default function loginUser(server: any) {
|
export default function loginUser(server: any) {
|
||||||
server.post('/auth/login')
|
server.post('/auth/login')
|
||||||
.send({ email: 'verifieduser@test.com', password: 'coolpassword' })
|
.send({ email: 'verifieduser@test.com', password: 'coolpassword' })
|
||||||
.end((err: any, res: Response) => {
|
.end((err: any, res: any) => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
|
console.log(res);
|
||||||
expect(res.status).toBe(200);
|
expect(res.status).toBe(200);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,14 @@ const server = supertest.agent(APISTRING);
|
|||||||
|
|
||||||
describe('login user', () => {
|
describe('login user', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
loginUser(server);
|
server.post('/auth/login')
|
||||||
|
.send({ email: 'verifieduser@test.com', password: 'coolpassword' })
|
||||||
|
.end((err, res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (err) throw err;
|
||||||
|
expect(res.status).toBe(200);
|
||||||
|
}
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('allows access to protected resources', () => {
|
it('allows access to protected resources', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user