Suppress logging when running tests
parent
a7e09f3d56
commit
0991405072
2
app.js
2
app.js
|
@ -419,7 +419,9 @@ initDb(config.databaseConnectionString, async (err, db) => {
|
|||
try{
|
||||
await app.listen(app.get('port'));
|
||||
app.emit('appStarted');
|
||||
if(process.env.NODE_ENV !== 'test'){
|
||||
console.log(colors.green('expressCart running on host: http://localhost:' + app.get('port')));
|
||||
}
|
||||
}catch(ex){
|
||||
console.error(colors.red('Error starting expressCart app:' + err));
|
||||
process.exit(2);
|
||||
|
|
|
@ -31,7 +31,9 @@ const indexProducts = (app) => {
|
|||
});
|
||||
|
||||
app.productsIndex = productsIndex;
|
||||
if(process.env.NODE_ENV !== 'test'){
|
||||
console.log(colors.cyan('- Product indexing complete'));
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
@ -67,7 +69,9 @@ const indexCustomers = (app) => {
|
|||
});
|
||||
|
||||
app.customersIndex = customersIndex;
|
||||
if(process.env.NODE_ENV !== 'test'){
|
||||
console.log(colors.cyan('- Customer indexing complete'));
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
@ -103,7 +107,9 @@ const indexOrders = (app, cb) => {
|
|||
});
|
||||
|
||||
app.ordersIndex = ordersIndex;
|
||||
if(process.env.NODE_ENV !== 'test'){
|
||||
console.log(colors.cyan('- Order indexing complete'));
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
@ -120,7 +126,9 @@ const fixProductDates = (products) => {
|
|||
|
||||
// start indexing products and orders
|
||||
const runIndexing = (app) => {
|
||||
if(process.env.NODE_ENV !== 'test'){
|
||||
console.info(colors.yellow('Setting up indexes..'));
|
||||
}
|
||||
|
||||
return Promise.all([
|
||||
indexProducts(app),
|
||||
|
|
Loading…
Reference in New Issue