Converts tests to TypeScript (#300)

This commit is contained in:
Jaco Greeff
2019-02-14 10:48:08 +01:00
committed by GitHub
parent 2a14a8b553
commit 1e6eb2c283
158 changed files with 89 additions and 183 deletions
+1
View File
@@ -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",
@@ -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);
@@ -71,7 +71,7 @@ describe('TransactionDb', () => {
db.put(key, value);
throw new Error('test');
})
});
}
).toThrow(/test/);
expect(memory.get(key)).toEqual(null);