2017-01-08 15:47:15 -05:00
|
|
|
/*globals describe, it*/
|
2018-08-31 09:24:45 +01:00
|
|
|
let Console = require('../lib/modules/console/');
|
2017-03-30 02:57:22 +09:00
|
|
|
let Plugins = require('../lib/core/plugins.js');
|
2018-08-08 13:42:45 +01:00
|
|
|
let IPC = require('../lib/core/ipc.js');
|
2017-03-30 02:57:22 +09:00
|
|
|
let assert = require('assert');
|
|
|
|
let version = require('../package.json').version;
|
2017-01-08 15:47:15 -05:00
|
|
|
|
|
|
|
describe('embark.Console', function() {
|
2018-08-08 13:42:45 +01:00
|
|
|
let ipc = new IPC({ipcRole: 'none'});
|
2017-03-30 02:57:22 +09:00
|
|
|
let plugins = new Plugins({plugins: {}});
|
2018-08-31 19:01:00 +01:00
|
|
|
let events = {once: () => {}, setCommandHandler: () => {}, emit: () => {}};
|
2018-08-31 09:24:45 +01:00
|
|
|
let console = new Console({}, {plugins, version, ipc, events});
|
2017-01-08 15:47:15 -05:00
|
|
|
|
|
|
|
describe('#executeCmd', function() {
|
|
|
|
|
|
|
|
describe('command: help', function() {
|
|
|
|
|
2017-01-12 20:42:33 -05:00
|
|
|
it('it should provide a help text', function(done) {
|
2018-08-08 13:42:45 +01:00
|
|
|
console.executeCmd('help', function(_err, output) {
|
2017-03-30 02:57:22 +09:00
|
|
|
let lines = output.split('\n');
|
2017-03-08 23:49:43 +09:00
|
|
|
assert.equal(lines[0], 'Welcome to Embark ' + version);
|
2017-01-08 15:47:15 -05:00
|
|
|
assert.equal(lines[2], 'possible commands are:');
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|