mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-13 17:15:56 +00:00
23 lines
579 B
JavaScript
23 lines
579 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 BrewGen.populateDB(BrewGen.random(50));
|
|
})
|
|
.then(() => {
|
|
console.log('Adding specific brews...');
|
|
return BrewGen.populateDB(BrewGen.static());
|
|
})
|
|
.then(() => {
|
|
return DB.close();
|
|
})
|
|
.catch(console.error);
|