30 lines
1.0 KiB
JavaScript
30 lines
1.0 KiB
JavaScript
|
var Embark = require('../lib/index');
|
||
|
var Cmd = require('../lib/cmd');
|
||
|
|
||
|
describe('embark.Cmd', function () {
|
||
|
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) {
|
||
|
let lines = output.split('\n');
|
||
|
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) {
|
||
|
let appname = 'deleteapp';
|
||
|
cmd.newApp(appname, function (output) {
|
||
|
let lines = output.split('\n');
|
||
|
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();
|
||
|
});
|
||
|
});
|
||
|
});
|