diff --git a/js/src/async-test.js b/js/src/async-test.js deleted file mode 100644 index 3360eac6c3..0000000000 --- a/js/src/async-test.js +++ /dev/null @@ -1,18 +0,0 @@ -// @flow - -import {test as mtest} from 'mocha'; - -export default function test(n: string, f: () => ?Promise) { - mtest(n, (done) => { - try { - const p = f(); - if (p instanceof Promise) { - p.then(done, done); - } else { - done(); - } - } catch (ex) { - done(ex); - } - }); -} diff --git a/js/src/blob-test.js b/js/src/blob-test.js index 90351ec141..c9da7bd412 100644 --- a/js/src/blob-test.js +++ b/js/src/blob-test.js @@ -1,10 +1,9 @@ // @flow import {assert} from 'chai'; -import {suite} from 'mocha'; +import {suite, test} from 'mocha'; import Random from './pseudo-random.js'; import MemoryStore from './memory-store.js'; -import test from './async-test.js'; import {newBlob, BlobWriter} from './blob.js'; import DataStore from './data-store.js'; import {blobType} from './type.js'; diff --git a/js/src/decode-test.js b/js/src/decode-test.js index 405813fabd..419e483870 100644 --- a/js/src/decode-test.js +++ b/js/src/decode-test.js @@ -6,7 +6,6 @@ import MemoryStore from './memory-store.js'; import Ref from './ref.js'; import RefValue from './ref-value.js'; import {default as Struct, StructMirror} from './struct.js'; -import test from './async-test.js'; import type {float64, int32, int64, uint8, uint16, uint32, uint64} from './primitives.js'; import type {TypeDesc} from './type.js'; import type {Value} from './value.js'; @@ -30,7 +29,7 @@ import {MapLeafSequence, NomsMap} from './map.js'; import {NomsBlob, newBlob} from './blob.js'; import {NomsSet, SetLeafSequence} from './set.js'; import {registerPackage, Package} from './package.js'; -import {suite} from 'mocha'; +import {suite, test} from 'mocha'; suite('Decode', () => { function stringToUint8Array(s): Uint8Array { diff --git a/js/src/encode-test.js b/js/src/encode-test.js index 9a926139f9..8a37e69a28 100644 --- a/js/src/encode-test.js +++ b/js/src/encode-test.js @@ -1,13 +1,12 @@ // @flow import {assert} from 'chai'; -import {suite} from 'mocha'; +import {suite, test} from 'mocha'; import MemoryStore from './memory-store.js'; import Ref from './ref.js'; import RefValue from './ref-value.js'; import Struct from './struct.js'; -import test from './async-test.js'; import type {NomsKind} from './noms-kind.js'; import {encodeNomsValue, JsonArrayWriter} from './encode.js'; import {Field, makeCompoundType, makeEnumType, makePrimitiveType, makeStructType, makeType, Type,} diff --git a/js/src/list-test.js b/js/src/list-test.js index 46df5620fc..52a8764a0f 100644 --- a/js/src/list-test.js +++ b/js/src/list-test.js @@ -1,13 +1,12 @@ // @flow import {assert} from 'chai'; -import {suite} from 'mocha'; +import {suite, test} from 'mocha'; import DataStore from './data-store.js'; import MemoryStore from './memory-store.js'; import RefValue from './ref-value.js'; import Struct from './struct.js'; -import test from './async-test.js'; import {calcSplices} from './edit-distance.js'; import {Field, makeCompoundType, makePrimitiveType, makeStructType, makeType} from './type.js'; import {flatten, flattenParallel} from './test-util.js'; diff --git a/js/src/map-test.js b/js/src/map-test.js index 1645f44a21..17c041f697 100644 --- a/js/src/map-test.js +++ b/js/src/map-test.js @@ -1,13 +1,12 @@ // @flow import {assert} from 'chai'; -import {suite} from 'mocha'; +import {suite, test} from 'mocha'; import DataStore from './data-store'; import MemoryStore from './memory-store.js'; import RefValue from './ref-value.js'; import Struct from './struct.js'; -import test from './async-test.js'; import {Field, makeCompoundType, makePrimitiveType, makeStructType, makeType} from './type.js'; import {flatten, flattenParallel} from './test-util.js'; import {invariant} from './assert.js'; diff --git a/js/src/memory-store-test.js b/js/src/memory-store-test.js index e919dd89bf..f4ad1df2a8 100644 --- a/js/src/memory-store-test.js +++ b/js/src/memory-store-test.js @@ -1,11 +1,10 @@ // @flow import {assert} from 'chai'; -import {suite} from 'mocha'; +import {suite, test} from 'mocha'; import Chunk from './chunk.js'; import MemoryStore from './memory-store.js'; import Ref from './ref.js'; -import test from './async-test.js'; suite('MemoryStore', () => { async function assertInputInStore(input: string, ref: Ref, ms: MemoryStore) { diff --git a/js/src/set-test.js b/js/src/set-test.js index 5409d00ec8..fab4b0a0b0 100644 --- a/js/src/set-test.js +++ b/js/src/set-test.js @@ -1,13 +1,12 @@ // @flow import {assert} from 'chai'; -import {suite} from 'mocha'; +import {suite, test} from 'mocha'; import DataStore from './data-store.js'; import MemoryStore from './memory-store.js'; import RefValue from './ref-value.js'; import Struct from './struct.js'; -import test from './async-test.js'; import {Field, makeCompoundType, makePrimitiveType, makeStructType, makeType} from './type.js'; import {flatten, flattenParallel} from './test-util.js'; import {invariant, notNull} from './assert.js';