BREAKING CHANGE(scope): change to @pushrocks scope
This commit is contained in:
@ -1,25 +1,25 @@
|
||||
import { expect, tap } from 'tapbundle'
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
|
||||
import * as npmextra from '../ts/index'
|
||||
import * as npmextra from '../ts/index';
|
||||
|
||||
let myKeyValueStore: npmextra.KeyValueStore
|
||||
let myKeyValueStore: npmextra.KeyValueStore;
|
||||
|
||||
tap.test('should create a keyValueStore', async () => {
|
||||
myKeyValueStore = new npmextra.KeyValueStore('custom','test')
|
||||
expect(myKeyValueStore).to.be.instanceof(npmextra.KeyValueStore)
|
||||
})
|
||||
myKeyValueStore = new npmextra.KeyValueStore('custom', 'test');
|
||||
expect(myKeyValueStore).to.be.instanceof(npmextra.KeyValueStore);
|
||||
});
|
||||
|
||||
tap.test('expect result to be empty', async () => {
|
||||
let result = myKeyValueStore.readAll()
|
||||
let result = myKeyValueStore.readAll();
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
expect(result).to.be.empty
|
||||
})
|
||||
expect(result).to.be.empty;
|
||||
});
|
||||
|
||||
tap.test('expect to add an object to the kv Store', async () => {
|
||||
await myKeyValueStore.writeAll({
|
||||
myKey: 'myValue'
|
||||
})
|
||||
await expect(myKeyValueStore.readKey('myKey')).to.eventually.equal('myValue')
|
||||
})
|
||||
});
|
||||
await expect(myKeyValueStore.readKey('myKey')).to.eventually.equal('myValue');
|
||||
});
|
||||
|
||||
tap.start()
|
||||
tap.start();
|
||||
|
43
test/test.ts
43
test/test.ts
@ -1,36 +1,33 @@
|
||||
import { expect, tap } from 'tapbundle'
|
||||
import path = require('path')
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import path = require('path');
|
||||
|
||||
// module to test
|
||||
import npmExtra = require('../ts/index')
|
||||
import npmExtra = require('../ts/index');
|
||||
|
||||
let testNpmextra: npmExtra.Npmextra
|
||||
let testNpmextra: npmExtra.Npmextra;
|
||||
|
||||
tap.test('should create a new Npmtextra instance', async () => {
|
||||
testNpmextra = new npmExtra.Npmextra('./test/')
|
||||
expect(testNpmextra).be.instanceof(npmExtra.Npmextra)
|
||||
})
|
||||
testNpmextra = new npmExtra.Npmextra('./test/');
|
||||
expect(testNpmextra).be.instanceof(npmExtra.Npmextra);
|
||||
});
|
||||
|
||||
tap.test('should state wether a npmextra.json exists', async () => {
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
expect(testNpmextra.npmextraJsonExists).be.true
|
||||
})
|
||||
expect(testNpmextra.npmextraJsonExists).be.true;
|
||||
});
|
||||
|
||||
tap.test('should pass through default value, if not overriden by config from file', async () => {
|
||||
let testData = testNpmextra.dataFor('testTool', { someKey2: 'someValue2' })
|
||||
console.log(testData)
|
||||
expect(testData).have.ownProperty('someKey2')
|
||||
})
|
||||
let testData = testNpmextra.dataFor('testTool', { someKey2: 'someValue2' });
|
||||
console.log(testData);
|
||||
expect(testData).have.ownProperty('someKey2');
|
||||
});
|
||||
|
||||
tap.test('should read a config file', async () => {
|
||||
let testData = testNpmextra.dataFor<any>(
|
||||
'testTool',
|
||||
{
|
||||
someKey2: 'someValue2'
|
||||
}
|
||||
)
|
||||
expect(testData).have.ownProperty('someKey2')
|
||||
expect(testData.testValue).equal(2)
|
||||
})
|
||||
let testData = testNpmextra.dataFor<any>('testTool', {
|
||||
someKey2: 'someValue2'
|
||||
});
|
||||
expect(testData).have.ownProperty('someKey2');
|
||||
expect(testData.testValue).equal(2);
|
||||
});
|
||||
|
||||
tap.start()
|
||||
tap.start();
|
||||
|
Reference in New Issue
Block a user