server test changes

This commit is contained in:
Jori Lallo
2016-09-11 12:35:14 -07:00
parent 1b14152291
commit 9b49b45fe7
3 changed files with 12 additions and 6 deletions

View File

@ -8,11 +8,11 @@ import { flushdb, seed, sequelize } from '../test/support';
const server = new TestServer(app.callback());
beforeEach(flushdb);
beforeEach(seed);
afterAll(() => server.close());
afterAll(() => sequelize.close());
it('should return known user', async () => {
await seed();
const user = await User.findOne({
where: {
email: 'user1@example.com',
@ -29,6 +29,7 @@ it('should return known user', async () => {
});
it('should require authentication', async () => {
await seed();
const res = await server.post('/api/user.info');
const body = await res.json();