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:
33
test/brew.apitest.js
Normal file
33
test/brew.apitest.js
Normal 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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user