update dependencies
This commit is contained in:
60
test/test.ts
60
test/test.ts
@@ -1,38 +1,32 @@
|
||||
import 'typings-test'
|
||||
import { tap, expect } from 'tapbundle'
|
||||
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(){
|
||||
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(){
|
||||
should(myNpm).have.property('version','1.0.0')
|
||||
})
|
||||
|
||||
it('should have .name',function(){
|
||||
should(myNpm).have.property('name','testpackage')
|
||||
})
|
||||
|
||||
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('.getNpmNameForDir()',function(){
|
||||
it('should return a name',function(){
|
||||
should(projectinfo.getNpmNameForDir(testBasePath)
|
||||
).equal('testpackage')
|
||||
})
|
||||
})
|
||||
let myNpm = new projectinfo.ProjectinfoNpm(testBasePath, { gitAccessToken: 'sometoken' })
|
||||
tap.test('should have .packageJson', async () => {
|
||||
expect(myNpm.packageJson).have.property('version', '1.0.0')
|
||||
expect(myNpm.packageJson).have.property('name', 'testpackage')
|
||||
})
|
||||
|
||||
tap.test('should have .version', async () => {
|
||||
expect(myNpm).have.property('version', '1.0.0')
|
||||
})
|
||||
|
||||
tap.test('should have .name', async () => {
|
||||
expect(myNpm).have.property('name', 'testpackage')
|
||||
})
|
||||
|
||||
tap.test('should have .license', async () => {
|
||||
expect(myNpm).have.property('license', 'MIT')
|
||||
})
|
||||
tap.test('should have .git', async () => {
|
||||
expect(myNpm.git.httpsUrl).equal('https://sometoken@github.com/someuser/somerepo.git')
|
||||
})
|
||||
tap.test('should return a name', async () => {
|
||||
expect(projectinfo.getNpmNameForDir(testBasePath)
|
||||
).equal('testpackage')
|
||||
})
|
||||
|
||||
tap.start()
|
||||
|
||||
Reference in New Issue
Block a user