1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-13 20:05:56 +00:00

Both types of tests are now working

This commit is contained in:
Scott Tolksdorf
2017-01-06 00:48:52 -05:00
parent 5820564894
commit 66ca09b36d
5 changed files with 36 additions and 33 deletions

View File

@@ -1,38 +1,24 @@
const should = require('chai').use(require('chai-as-promised')).should();
const BrewDB = require('../server/db.js');
const BrewData = require('../server/brew.data.js');
describe.skip('BrewDB', () => {
describe('BrewDB', () => {
before('Await DB', ()=>{
return BrewDB.connect()
.then(()=>{
console.log('connected');
})
.catch(()=>{
console.log('sdfdsfdsfdsf');
})
return BrewDB.connect().catch()
});
it('generates ID on save', (done) => {
console.log('getting here');
it('generates ID on save', () => {
return BrewData.create({
text : "Brew Text"
}).then((brew) => {
console.log('here2');
should.exist(brew);
brew.should.have.property('editId').that.is.a('string');
brew.should.have.property('shareId').that.is.a('string');
brew.should.have.property('text').that.is.a('string');
console.log('and I am done');
done();
})
.catch((e) => {
console.log('an error', e);
})
});
});