embark-area-51/test/console.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-01-08 20:47:15 +00:00
/*globals describe, it*/
2018-08-31 08:24:45 +00:00
let Console = require('../lib/modules/console/');
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-31 18:01:00 +00:00
let events = {once: () => {}, setCommandHandler: () => {}, emit: () => {}};
let embarkObject = {
events: events,
logger: plugins.logger,
registerConsoleCommand: (cmd, opt) => {},
embarkConfig: {
options: {
solc: {
"optimize": true,
"optimize-runs": 200
}
}
}
}
let console = new Console(embarkObject, {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();
});
});
});
});
});