diff --git a/Commands/init.js b/Commands/init.js index 11108c5..1dcdac9 100644 --- a/Commands/init.js +++ b/Commands/init.js @@ -164,9 +164,9 @@ module.exports = { }) - .catch(function catchError(error) { - utils.displayError(error, res); - }); + .catch(function catchError(error) { + utils.displayError(error, res); + }); } }; diff --git a/Commands/laravelConfig.js b/Commands/laravelConfig.js index 086747c..a81ac2d 100644 --- a/Commands/laravelConfig.js +++ b/Commands/laravelConfig.js @@ -149,7 +149,7 @@ var nodeConfig = function nodeConfig() { transformer = require(appdir + '/lib/Config/' + toTransform); loaded = true; } catch (errorInUserLoad) { - error = 'cant find /lib/Config/' + toTransform + '.js'; + error = `can't find /lib/Config/${toTransform}.js`; } if (loaded) { try { @@ -166,10 +166,10 @@ var nodeConfig = function nodeConfig() { loaded = true; } catch (errorCoreload) { - if (!error || error === 'cant find /lib/Config/' + toTransform + '.js') { + if (!error || error === `can't find /lib/Config/${toTransform}.js`) { /* istanbul ignore else */ if (errorCoreload.code) { - error = 'cant find /lib/Config/' + toTransform + '.js'; + error = `can't find /lib/Config/${toTransform}.js`; } else { error = errorCoreload.message; } @@ -179,7 +179,7 @@ var nodeConfig = function nodeConfig() { } if (!loaded) { conf = laravelConfig[toTransform]; - response.red('config ' + toTransform + ' not trandformed').ln(); + response.red('config ' + toTransform + ' not transformed').ln(); response.red(error).ln(); } var content = utils.formatConfig(conf); diff --git a/bootstrap/index.js b/bootstrap/index.js index 2d57fc8..88ce738 100644 --- a/bootstrap/index.js +++ b/bootstrap/index.js @@ -17,8 +17,8 @@ app.logger.inspectOptions = { }; /* istanbul ignore else*/ if (app.config('app.debug')) { - process.env.DEBUG = logPrefix + '*'; - console.log('set env.debug to ' + logPrefix + '*'); + process.env.DEBUG = logPrefix + ':*'; + console.log('set env.debug to ' + logPrefix + ':*'); } app.trans = require('i18n'); diff --git a/lib/shell/lib/Shell.js b/lib/shell/lib/Shell.js index b6f85b6..9081c90 100644 --- a/lib/shell/lib/Shell.js +++ b/lib/shell/lib/Shell.js @@ -2,7 +2,7 @@ /* global app */ /*eslint no-magic-numbers: 0 */ -var EventEmitter, Interface, Request, Response, shell, events, readline, styles; +var EventEmitter, Interface, Request, Response, shell, events, readline; readline = require('readline'); events = require('events'); @@ -95,13 +95,13 @@ shell = (function exportShell(_super) { process.chdir(settings.chdir); } console.log('init completed'); - this.initialised = true; + this.initialized = true; return this; }; Shell.prototype.start = function start() { - if (!this.initialised) { - throw new Error('app not initialised run Shell.init()'); + if (!this.initialized) { + throw new Error('app not initialized run Shell.init()'); } console.debug('start app'); var command, noPrompt; diff --git a/test/Commands/testLaravelConfig.js b/test/Commands/testLaravelConfig.js index a8ff2af..a2bb93f 100644 --- a/test/Commands/testLaravelConfig.js +++ b/test/Commands/testLaravelConfig.js @@ -84,7 +84,7 @@ module.exports = { }; app.start(); }, - 'test write transorm fail': function testMakeCommandFail(test) { + 'test write transform fail': function testMakeCommandFail(test) { var stdout = []; bddStdin(''); process.argv = ['node', appdir + '/artisan', 'laravel:config']; @@ -341,7 +341,7 @@ module.exports = { process.stdin.destroy = function stdinDestroy() { unhookIntercept(); var toTest = [ - 'config example not trandformed', + 'config example not transformed', 'error in example file' ]; each(toTest, function eachToTest(value) { diff --git a/test/Commands/testModelsCreator.js b/test/Commands/testModelsCreator.js index 1cae0ca..435193c 100644 --- a/test/Commands/testModelsCreator.js +++ b/test/Commands/testModelsCreator.js @@ -11,11 +11,12 @@ var each = require('lodash/each'); var Config = require('../../lib/Config'); var debugLogger = require('debug-logger'); var database, core, bddStdin; +var globalApp; module.exports = { setUp: function setUp(callback) { bddStdin = new BddStdin().type; rewire('../utils/bootstrap'); - + globalApp = global.app; app.configure(function configureApp() { app.use(Shell.router({ shell: app @@ -27,8 +28,8 @@ module.exports = { callback(); }, tearDown: function tearDown(callback) { - app.config().set('database', database); - app.config().set('core', core); + globalApp.config().set('database', database); + globalApp.config().set('core', core); callback(); }, 'test model creator': function testModelsCreator(test) { @@ -184,7 +185,6 @@ module.exports = { if (typeof txt === 'string') { stdout.push(txt.replace(/\u001b\[.*?m/g, '')); } - // return ''; }); app.init({ chdir: appdir + '/' @@ -200,7 +200,7 @@ module.exports = { unhookIntercept(); var toTest = [ - "ER_DBACCESS_DENIED_ERROR: Access denied for user 'testdb'@'localhost' to database 'notexist'" + "Access denied for user 'testdb'@'localhost' to database 'notexist'" ]; each(toTest, function eachToTest(value) { test.ok(stdout.indexOf(value) > -1, value); diff --git a/test/bootstrap/testInitConfig.js b/test/bootstrap/testInitConfig.js index 27e7465..0c1cf36 100644 --- a/test/bootstrap/testInitConfig.js +++ b/test/bootstrap/testInitConfig.js @@ -36,7 +36,7 @@ module.exports = { }, 'test env default': function testEnvDefault(test) { test.expect(1); - test.equal(app.config().env('wiilNotExist', 'default'), 'default', 'env not match'); + test.equal(app.config().env('willNotExist', 'default'), 'default', 'env not match'); test.done(); } diff --git a/test/lib/shell/plugins/testHelp.js b/test/lib/shell/plugins/testHelp.js index 9185f26..1379fde 100644 --- a/test/lib/shell/plugins/testHelp.js +++ b/test/lib/shell/plugins/testHelp.js @@ -44,7 +44,7 @@ module.exports = { }; app.start(); }, - 'test help plugin custom intoduction': function customIntroduction(test) { + 'test help plugin custom introduction': function customIntroduction(test) { var stdout = []; process.argv = ['node', appdir + '/artisan']; var unhookIntercept = intercept(function onIntercept(txt) { @@ -110,7 +110,7 @@ module.exports = { '<2argument> ', '[] ', 'Arguments:', - ' argument test [default: "default"]\n 2argument deuxieme argument \n autre [default: "pour"]\n', + ' argument test [default: "default"]\n 2argument deuxieme argument \n autre [default: "pour"]\n', 'Options:', '--option ', 'test:second',