projectinfo/test/test.ts

40 lines
1.1 KiB
TypeScript
Raw Normal View History

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-20 05:06:43 +00:00
});
2016-02-20 04:05:07 +00:00
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
});