diff --git a/index.ts b/index.ts index 843cf42a409cba5a8d3bc82e418d61a73f7c70cb..a8f5488137277166f6722d817bf430e87b36e89c 100644 --- a/index.ts +++ b/index.ts @@ -614,3 +614,5 @@ export const Duniter = { } } +export * from './test/unit-tools' +export * from './test/integration/tools/toolbox' diff --git a/test/integration/tools/http-expect.ts b/test/integration/tools/http-expect.ts index 141650719835a2296e6029b6312de4c88af834d0..26444a99c0b1957220db59368bca668efe8d8561 100644 --- a/test/integration/tools/http-expect.ts +++ b/test/integration/tools/http-expect.ts @@ -59,7 +59,7 @@ export async function expectJSON<T>(promise:Promise<T>, json:any) { try { const resJson = await promise; Underscore.keys(json).forEach(function(key){ - resJson.should.have.property(String(key)).equal(json[key]); + (resJson as any).should.have.property(String(key)).equal(json[key]); }); } catch (err) { if (err.response) { diff --git a/test/unit-tools.ts b/test/unit-tools.ts index f27b551d092dcf71db141608acbf7e23b2021f0c..c154cc34c32e8f6d594ea9dfa55eb3b4e3c05596 100644 --- a/test/unit-tools.ts +++ b/test/unit-tools.ts @@ -12,6 +12,7 @@ // GNU Affero General Public License for more details. import * as assert from 'assert' +const should = require('should') export async function shouldThrow(promise:Promise<any>) { let error = false @@ -20,8 +21,8 @@ export async function shouldThrow(promise:Promise<any>) { } catch (e) { error = true } - promise.should.be.rejected() - error.should.equal(true) + (promise as any).should.be.rejected() + (error as any).should.equal(true) } export async function shouldNotFail<T>(promise:Promise<T>) {