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