projectinfo/test/test.ts

44 lines
1.3 KiB
TypeScript
Raw Normal View History

2016-06-09 01:13:40 +00:00
import "typings-test";
2016-02-20 04:05:07 +00:00
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(){
2016-02-23 08:36:40 +00:00
var myNpm = projectinfo.npm(testBasePath,{gitAccessToken:"sometoken"});
2016-02-20 04:05:07 +00:00
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-23 07:48:41 +00:00
it("should have .git",function(){
myNpm.git.httpsUrl
2016-02-23 08:36:40 +00:00
.should.equal("https://sometoken@github.com/someuser/somerepo.git");
2016-02-23 07:48:41 +00:00
});
2016-02-21 16:17:31 +00:00
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
});