2016-06-10 01:10:21 +00:00
|
|
|
"use strict";
|
|
|
|
require("typings-test");
|
2016-06-10 02:13:23 +00:00
|
|
|
var smartcli = require("../dist/index");
|
2016-05-11 00:11:40 +00:00
|
|
|
var beautylog = require("beautylog");
|
|
|
|
var should = require("should");
|
2016-06-10 02:13:23 +00:00
|
|
|
describe("smartcli.Smartcli class", function () {
|
|
|
|
var smartCliTestObject;
|
|
|
|
describe("new Smartcli()", function () {
|
|
|
|
it("should create a new Smartcli", function () {
|
|
|
|
smartCliTestObject = new smartcli.Smartcli();
|
|
|
|
smartCliTestObject.should.be.instanceof(smartcli.Smartcli);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
describe(".addCommand", function () {
|
|
|
|
it("should add an command", function () {
|
|
|
|
smartCliTestObject.addCommand({
|
|
|
|
commandName: "awesome"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
describe(".standardTask", function () {
|
|
|
|
it("should start parsing a standardTask", function (done) {
|
|
|
|
smartCliTestObject.standardTask()
|
|
|
|
.then(function () {
|
|
|
|
console.log("this is the standard Task!");
|
|
|
|
});
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
describe(".startParse", function () {
|
|
|
|
it("should start parsing the CLI input", function () {
|
|
|
|
smartCliTestObject.startParse();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2016-05-10 01:18:40 +00:00
|
|
|
|
2016-06-10 02:13:23 +00:00
|
|
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFFdEIsSUFBTyxRQUFRLFdBQVcsZUFBZSxDQUFDLENBQUM7QUFDM0MsSUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBQ3JDLElBQUksTUFBTSxHQUFHLE9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