mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-04 11:24:22 +00:00
Merge pull request #229 from toadkicker/fix-228
changes undefined process.exit(code) to process.exit(9)
This commit is contained in:
commit
112a582e0e
@ -33,10 +33,11 @@ Cmd.prototype.newApp = function() {
|
|||||||
.description('new application')
|
.description('new application')
|
||||||
.action(function(name, options) {
|
.action(function(name, options) {
|
||||||
if (name === undefined) {
|
if (name === undefined) {
|
||||||
|
|
||||||
console.log("please specify your app Name".red);
|
console.log("please specify your app Name".red);
|
||||||
console.log("e.g embark new MyApp".green);
|
console.log("e.g embark new MyApp".green);
|
||||||
console.log("e.g embark new --help for more information".green);
|
console.log("e.g embark new --help for more information".green);
|
||||||
process.exit(code);
|
process.exit(9);
|
||||||
}
|
}
|
||||||
self.Embark.generateTemplate('boilerplate', './', name);
|
self.Embark.generateTemplate('boilerplate', './', name);
|
||||||
});
|
});
|
||||||
|
30
test/cmd.js
Normal file
30
test/cmd.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
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) {
|
||||||
|
var 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) {
|
||||||
|
var appname = 'deleteapp';
|
||||||
|
cmd.newApp(appname, function (output) {
|
||||||
|
var 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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user