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