update to meet newest standards

This commit is contained in:
2016-11-26 14:45:56 +01:00
parent fcd559090a
commit 9030619046
22 changed files with 265 additions and 154 deletions

View File

@@ -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')
})
})
})