0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 10:52:46 +00:00

Triyng to setup api tests

This commit is contained in:
Scott Tolksdorf
2017-01-01 17:06:44 -08:00
parent a0bc4fddf8
commit 537a75b2ab
4 changed files with 43 additions and 10 deletions

33
test/brew.apitest.js Normal file
View File

@@ -0,0 +1,33 @@
const testing = require('./test.init.js');
const request = require('supertest-as-promised');
const app = require('../server.js')
const apiPath = '/api/brew';
describe('/api/brew', () => {
before('Await DB', ()=>{
return require('db.js').connect();
});
describe('POST', () => {
it('creates a new brew', () => {
return request(app)
.post(apiPath)
.send({
text : 'Brew Text'
})
.expect(200)
.then((res) => {
console.log(res.body);
});
});
});
});