projectinfo/test/test.ts

39 lines
1.2 KiB
TypeScript
Raw Normal View History

2016-11-26 13:45:56 +00:00
import 'typings-test'
import projectinfo = require('../dist/index')
let should = require('should')
let path = require('path')
let testBasePath = path.resolve(__dirname)
2016-02-20 04:05:07 +00:00
2016-11-26 13:45:56 +00:00
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')
})
2016-02-20 04:05:07 +00:00
2016-11-26 13:45:56 +00:00
it('should have .version',function(){
should(myNpm).have.property('version','1.0.0')
})
2016-02-20 04:05:07 +00:00
2016-11-26 13:45:56 +00:00
it('should have .name',function(){
should(myNpm).have.property('name','testpackage')
})
2016-02-20 04:05:07 +00:00
2016-11-26 13:45:56 +00:00
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')
})
2016-02-21 16:17:31 +00:00
2016-11-26 13:45:56 +00:00
})
2016-02-20 05:06:43 +00:00
2016-11-26 13:45:56 +00:00
describe('.getNpmNameForDir()',function(){
it('should return a name',function(){
should(projectinfo.getNpmNameForDir(testBasePath)
).equal('testpackage')
})
2016-02-20 05:06:43 +00:00
})
2016-11-26 13:45:56 +00:00
})