Converts tests to TypeScript (#300)
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
"@polkadot/trie-hash": "^0.34.3",
|
||||
"@polkadot/util": "^0.34.3",
|
||||
"@types/mkdirp": "^0.5.2",
|
||||
"@types/rimraf": "^2.0.2",
|
||||
"@types/snappy": "^6.0.0",
|
||||
"lru_map": "^0.3.3",
|
||||
"mkdirp": "^0.5.1",
|
||||
|
||||
+3
-6
@@ -2,11 +2,6 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import mkdirp from 'mkdirp';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import rimraf from 'rimraf';
|
||||
|
||||
import FileFlatDb from './index';
|
||||
|
||||
describe.skip('FileFlatDb (compacting)', () => {
|
||||
@@ -14,7 +9,9 @@ describe.skip('FileFlatDb (compacting)', () => {
|
||||
|
||||
it('compacts without failing', () => {
|
||||
expect(
|
||||
combined.maintain(() => {})
|
||||
combined.maintain(() => {
|
||||
// noop
|
||||
})
|
||||
).not.toBe(0);
|
||||
});
|
||||
});
|
||||
@@ -3,7 +3,6 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import mkdirp from 'mkdirp';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import rimraf from 'rimraf';
|
||||
|
||||
@@ -42,11 +41,11 @@ const VAL_F = new Uint8Array([0x42, 1, 2, 3, 4, 5, 6, 0x69]);
|
||||
|
||||
// NOTE Skipped, doesn't seem to be too happy on CI (cwd issues?)
|
||||
describe.skip('FileFlatDb (basics)', () => {
|
||||
const testGet = (key, value) =>
|
||||
expect(store.get(key)).toEqual(value);
|
||||
|
||||
const location = path.join(process.cwd(), '--test-FileFlatDb');
|
||||
let store;
|
||||
let store: FileFlatDb;
|
||||
|
||||
const testGet = (key: Uint8Array, value: Uint8Array) =>
|
||||
expect(store.get(key)).toEqual(value);
|
||||
|
||||
beforeAll(() => {
|
||||
mkdirp.sync(location);
|
||||
+1
-1
@@ -71,7 +71,7 @@ describe('TransactionDb', () => {
|
||||
db.put(key, value);
|
||||
|
||||
throw new Error('test');
|
||||
})
|
||||
});
|
||||
}
|
||||
).toThrow(/test/);
|
||||
expect(memory.get(key)).toEqual(null);
|
||||
Reference in New Issue
Block a user