npmextra/test/test.ts

31 lines
950 B
TypeScript
Raw Normal View History

2016-09-23 20:13:06 +00:00
import 'typings-test'
import path = require('path')
import * as should from 'should'
2016-07-16 23:23:22 +00:00
2016-09-23 20:13:06 +00:00
import npmExtra = require('../dist/index')
describe('npmextra',function(){
it('should state wether a npmextra.json exists', function() {
should(npmExtra.configFilePresent('./test/')).be.true()
})
it('should read a config file',function(){
2016-07-17 14:34:31 +00:00
let testData = npmExtra.dataFor({
2016-09-23 20:13:06 +00:00
toolName: 'testTool',
defaultSettings: {someKey2: 'someValue2'},
cwd: path.join(process.cwd(),'./test/')
})
should(testData).have.ownProperty('someKey2')
})
it('should read a config file',function(){
let testData = npmExtra.dataFor({
2016-09-23 20:13:06 +00:00
toolName: 'testTool',
defaultSettings: {someKey2: 'someValue2'},
cwd: path.join(process.cwd(),'test/')
})
should(testData).have.ownProperty('someKey2')
should(testData.testValue).equal(2)
})
})