Skip to content
Snippets Groups Projects
Commit d37aa060 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] Also export Test tools

parent e7da47ed
No related branches found
No related tags found
No related merge requests found
......@@ -614,3 +614,5 @@ export const Duniter = {
}
}
export * from './test/unit-tools'
export * from './test/integration/tools/toolbox'
......@@ -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) {
......
......@@ -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>) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment