embark/test/console.js

29 lines
898 B
JavaScript
Raw Normal View History

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-30 10:17:44 +00:00
let events = {on: () => {}}
let console = new Console({plugins, version, ipc, events});
2017-01-08 20:47:15 +00:00
describe('#executeCmd', function() {
describe('command: help', function() {
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');
assert.equal(lines[0], 'Welcome to Embark ' + version);
2017-01-08 20:47:15 +00:00
assert.equal(lines[2], 'possible commands are:');
done();
});
});
});
});
});