fix(core): update
This commit is contained in:
11
test/test.ts
11
test/test.ts
@ -1,17 +1,24 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as levelcache from '../ts/index';
|
||||
import { CacheEntry } from '../ts/index';
|
||||
|
||||
let testLevelCache: levelcache.LevelCache;
|
||||
|
||||
tap.test('should create a new levelcache instance', async () => {
|
||||
testLevelCache = new levelcache.LevelCache({
|
||||
|
||||
cacheId: 'myCache'
|
||||
});
|
||||
expect(testLevelCache).to.be.instanceOf(levelcache.LevelCache);
|
||||
});
|
||||
|
||||
tap.test('should cache a value', async () => {
|
||||
testLevelCache.
|
||||
await testLevelCache.storeCacheEntryByKey('mykey', new CacheEntry({
|
||||
contents: Buffer.from('heythere'),
|
||||
ttl: 10000,
|
||||
typeInfo: 'string'
|
||||
}));
|
||||
const result = await testLevelCache.retrieveCacheEntryByKey('mykey');
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
Reference in New Issue
Block a user