2016-02-20 04:05:07 +00:00
|
|
|
/// <reference path="../ts/typings/main.d.ts" />
|
|
|
|
var projectinfo = require("../dist/index.js");
|
|
|
|
var should = require("should");
|
|
|
|
var path = require("path");
|
|
|
|
var testBasePath = path.resolve(__dirname);
|
|
|
|
describe("projectinfo", function () {
|
|
|
|
describe(".npm() return", function () {
|
|
|
|
var myNpm = projectinfo.npm(testBasePath);
|
|
|
|
it("should have .packageJson", function () {
|
|
|
|
myNpm.packageJson
|
|
|
|
.should.have.property("version", "1.0.0");
|
|
|
|
myNpm.packageJson
|
|
|
|
.should.have.property("name", "testpackage");
|
|
|
|
});
|
|
|
|
it("should have .version", function () {
|
|
|
|
myNpm
|
2016-02-21 16:17:31 +00:00
|
|
|
.should.have.property("version", "1.0.0");
|
2016-02-20 04:05:07 +00:00
|
|
|
});
|
|
|
|
it("should have .name", function () {
|
|
|
|
myNpm
|
|
|
|
.should.have.property("name", "testpackage");
|
|
|
|
});
|
2016-02-21 16:17:31 +00:00
|
|
|
it("should have .license", function () {
|
|
|
|
myNpm
|
|
|
|
.should.have.property("license", "MIT");
|
|
|
|
});
|
2016-02-20 04:05:07 +00:00
|
|
|
});
|
2016-02-20 05:06:43 +00:00
|
|
|
describe(".getName()", function () {
|
|
|
|
it("should return a name", function () {
|
|
|
|
projectinfo.getName(testBasePath)
|
|
|
|
.should.equal("testpackage");
|
|
|
|
});
|
|
|
|
});
|
2016-02-20 04:05:07 +00:00
|
|
|
});
|
|
|
|
|
2016-02-21 16:17:31 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksV0FBVyxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0FBQzlDLElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUMv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2VcIik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGl0KFwic2hvdWxkIGhhdmUgLnZlcnNpb25cIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG1cbiAgICAgICAgICAgICAgICAuc2hvdWxkLmhhdmUucHJvcGVydHkoXCJ2ZXJzaW9uXCIsXCIxLjAuMFwiKVxuICAgICAgICB9KTtcblxuICAgICAgICBpdChcInNob3VsZCBoYXZlIC5uYW1lXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIG15TnBtXG4gICAgICAgICAgICAgICAgLnNob3VsZC5oYXZlLnByb3BlcnR5KFwibmFtZVwiLFwidGVzdHBhY2thZ2VcIik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGl0KFwic2hvdWxkIGhhdmUgLmxpY2Vuc2VcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG1cbiAgICAgICAgICAgICAgICAuc2hvdWxkLmhhdmUucHJvcGVydHkoXCJsaWNlbnNlXCIsXCJNSVRcIik7XG4gICAgICAgIH0pO1xuXG4gICAgfSk7XG5cbiAgICBkZXNjcmliZShcIi5nZXROYW1lKClcIixmdW5jdGlvbigpe1xuICAgICAgICBpdChcInNob3VsZCByZXR1cm4gYSBuYW1lXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIHByb2plY3RpbmZvLmdldE5hbWUodGVzdEJhc2VQYXRoKVxuICAgICAgICAgICAgICAgIC5zaG91bGQuZXF1YWwoXCJ0ZXN0cGFja2FnZVwiKTtcbiAgICAgICAgfSk7XG4gICAgfSlcbn0pOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|