1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-22 01:01:29 +00:00

adding in some api tests

This commit is contained in:
Scott Tolksdorf
2017-01-01 17:47:26 -08:00
parent 5ba3f98696
commit 10f4759471
6 changed files with 68 additions and 14 deletions

37
api.test.js Normal file
View File

@@ -0,0 +1,37 @@
const request = require('superagent');
const brewData = require('./server/brew.data.js');
const path = 'localhost:8000';
request.post(`${path}/api/brew`)
.send({
text : 'new brew'
})
.end((err, res) => {
console.log(err, res && res.body);
console.log('creaitng brew');
//creating brew
brewData.create({
text : 'yeah yeah'
})
.then((brew) => {
console.log(brew);
})
.catch((e) => {
console.log(e);
})
/*
res.body.text = 'check it';
brewData.update(res.body)
.then((newBrew) => {
console.log(newBrew);
})
.catch((e) => {
console.log(e);
})
*/
})