0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 04:22:40 +00:00

created a brew generator and chai plugin for easier testing

This commit is contained in:
Scott Tolksdorf
2017-01-27 18:38:09 -05:00
parent 8018442f25
commit a826aaffd9
6 changed files with 124 additions and 111 deletions

22
scripts/populate.js Normal file
View File

@@ -0,0 +1,22 @@
//Populates the DB with a bunch of brews for UI testing
const _ = require('lodash');
const DB = require('../server/db.js');
const BrewData = require('../server/brew.data.js');
const BrewGen = require('../test/brew.gen.js');
return Promise.resolve()
.then(DB.connect)
.then(BrewData.removeAll)
.then(() => {
console.log('Adding random brews...');
return return BrewGen.populateDB(BrewGen.random(5));
})
.then(() => {
console.log('Adding specific brews...');
return return BrewGen.populateDB(BrewGen.static());
})
.then(() => {
return DB.close();
})
.catch(console.error);