mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 04:22:40 +00:00
33 lines
501 B
JavaScript
33 lines
501 B
JavaScript
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);
|
|
});
|
|
});
|
|
|
|
});
|
|
|
|
|
|
}); |