embark/test/cmd.js

41 lines
1.4 KiB
JavaScript
Raw Normal View History

2017-03-08 13:52:06 +00:00
var Embark = require('../lib/index');
var Cmd = require('../lib/cmd');
describe('embark.Cmd', function () {
2017-03-12 03:23:30 +00:00
this.timeout(0);
2017-03-08 13:52:06 +00:00
var cmd = new Cmd(Embark);
describe('#new', function () {
it('it should not create an app without a name', function (done) {
cmd.newApp(undefined, function (output) {
2017-03-08 13:56:27 +00:00
var lines = output.split('\n');
2017-03-08 13:52:06 +00:00
assert.equal(lines[0], 'please specify your app Name');
assert.equal(lines[1], 'e.g embark new MyApp');
assert.equal(lines[2], 'e.g embark new --help for more information');
});
done();
});
it('it should create an app with a name', function (done) {
2017-03-08 13:56:27 +00:00
var appname = 'deleteapp';
2017-03-08 13:52:06 +00:00
cmd.newApp(appname, function (output) {
2017-03-08 13:56:27 +00:00
var lines = output.split('\n');
2017-03-08 13:52:06 +00:00
assert.equal(lines[0], 'Initializing Embark Template....');
assert.equal(lines[1], 'Installing packages.. this can take a few seconds');
assert.equal(lines[2], 'Init complete');
assert.equal(lines[3], 'App ready at ./' + appname);
});
done();
});
});
2017-03-12 03:23:30 +00:00
// describe("#help", function () {
// it('it should spit out helpful text if no arguments are supplied', function (done) {
// cmd.process([], function (output) {
// var lines = output.split('\n');
// assert.equal(lines[0], '\n');
// assert.equal(lines[1], 'Usage:');
// done();
// });
// })
// })
2017-03-08 13:52:06 +00:00
});