Clean logs on start - and eslint/mocha with code coverage (#1945)

* Clean logs on startup; install server-side testing/linting

* Add eslint config, make all of app/ conform to its demands

* Add Node.js testing and linting to CI

* Lock project to Node.js 7.9.0, used by Electron 1.7.10

* New eslint error: trailing commas in function argumensts

Node 7.9.0 doesn't like trailing commas, but Electron does

* Move electron to devDependency, tell eslint it's built-in
This commit is contained in:
Scott Nonnenberg 2018-01-08 13:19:25 -08:00 committed by GitHub
parent 6464d0a5fa
commit 64fe9dbfb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 1782 additions and 316 deletions

View file

@ -1,9 +1,12 @@
const path = require('path');
const config = require('config');
const packageJson = require('../package.json');
const environment = packageJson.environment || process.env.NODE_ENV || 'development';
config.environment = environment;
// Set environment vars to configure node-config before requiring it
process.env.NODE_ENV = environment;
@ -19,8 +22,6 @@ if (environment === 'production') {
process.env.SUPPRESS_NO_CONFIG_WARNING = '';
}
const config = require('config');
config.environment = environment;
// Log resulting env vars in use by config
[
@ -30,9 +31,9 @@ config.environment = environment;
'ALLOW_CONFIG_MUTATIONS',
'HOSTNAME',
'NODE_APP_INSTANCE',
'SUPPRESS_NO_CONFIG_WARNING'
].forEach(function(s) {
console.log(s + ' ' + config.util.getEnv(s));
'SUPPRESS_NO_CONFIG_WARNING',
].forEach((s) => {
console.log(`${s} ${config.util.getEnv(s)}`);
});
module.exports = config;