update to meet newest standards
This commit is contained in:
70
test/test.ts
70
test/test.ts
@@ -1,44 +1,38 @@
|
||||
import "typings-test";
|
||||
var projectinfo = require("../dist/index.js");
|
||||
var should = require("should");
|
||||
var path = require("path");
|
||||
var testBasePath = path.resolve(__dirname);
|
||||
import 'typings-test'
|
||||
import projectinfo = require('../dist/index')
|
||||
let should = require('should')
|
||||
let path = require('path')
|
||||
let testBasePath = path.resolve(__dirname)
|
||||
|
||||
describe("projectinfo",function(){
|
||||
describe(".npm() return",function(){
|
||||
var myNpm = projectinfo.npm(testBasePath,{gitAccessToken:"sometoken"});
|
||||
it("should have .packageJson",function(){
|
||||
myNpm.packageJson
|
||||
.should.have.property("version","1.0.0");
|
||||
myNpm.packageJson
|
||||
.should.have.property("name","testpackage");
|
||||
});
|
||||
describe('projectinfo',function(){
|
||||
describe('.npm() return',function(){
|
||||
let myNpm = new projectinfo.ProjectinfoNpm(testBasePath,{gitAccessToken: 'sometoken'})
|
||||
it('should have .packageJson',function(){
|
||||
should(myNpm.packageJson).have.property('version','1.0.0')
|
||||
should(myNpm.packageJson).have.property('name','testpackage')
|
||||
})
|
||||
|
||||
it("should have .version",function(){
|
||||
myNpm
|
||||
.should.have.property("version","1.0.0")
|
||||
});
|
||||
it('should have .version',function(){
|
||||
should(myNpm).have.property('version','1.0.0')
|
||||
})
|
||||
|
||||
it("should have .name",function(){
|
||||
myNpm
|
||||
.should.have.property("name","testpackage");
|
||||
});
|
||||
it('should have .name',function(){
|
||||
should(myNpm).have.property('name','testpackage')
|
||||
})
|
||||
|
||||
it("should have .license",function(){
|
||||
myNpm
|
||||
.should.have.property("license","MIT");
|
||||
});
|
||||
it("should have .git",function(){
|
||||
myNpm.git.httpsUrl
|
||||
.should.equal("https://sometoken@github.com/someuser/somerepo.git");
|
||||
});
|
||||
it('should have .license',function(){
|
||||
should(myNpm).have.property('license','MIT')
|
||||
})
|
||||
it('should have .git',function(){
|
||||
should(myNpm.git.httpsUrl).equal('https://sometoken@github.com/someuser/somerepo.git')
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
describe(".getName()",function(){
|
||||
it("should return a name",function(){
|
||||
projectinfo.getName(testBasePath)
|
||||
.should.equal("testpackage");
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
describe('.getNpmNameForDir()',function(){
|
||||
it('should return a name',function(){
|
||||
should(projectinfo.getNpmNameForDir(testBasePath)
|
||||
).equal('testpackage')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user