mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-13 18:55:56 +00:00
23 lines
592 B
JavaScript
23 lines
592 B
JavaScript
//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);
|