From 9598ed09f7b337380b2a5306b41f613402ac9536 Mon Sep 17 00:00:00 2001 From: cgeek <cem.moreau@gmail.com> Date: Tue, 18 Jul 2017 13:42:57 +0200 Subject: [PATCH] [fix] #1037 Local tests fix --- test/fast/block_local.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/fast/block_local.js b/test/fast/block_local.js index d59fb6198..c8f286f5e 100644 --- a/test/fast/block_local.js +++ b/test/fast/block_local.js @@ -4,7 +4,7 @@ const should = require('should'); const parsers = require('duniter-common').parsers; const indexer = require('../../app/lib/indexer').Indexer const LOCAL_RULES = require('../../app/lib/rules/local_rules').LOCAL_RULES_FUNCTIONS -const CHECK = require('../../app/lib/rules').CHECK +const ALIAS = require('../../app/lib/rules').ALIAS const blocks = require('../data/blocks.js'); const parser = parsers.parseBlock; const Block = require('duniter-common').document.Block @@ -25,7 +25,7 @@ const conf = { describe("Block local coherence", function(){ - it('a valid block should be well formatted', test(CHECK.ASYNC.ALL_LOCAL_BUT_POW_AND_SIGNATURE, blocks.VALID_ROOT)); + it('a valid block should be well formatted', test(ALIAS.ALL_LOCAL_BUT_POW_AND_SIGNATURE, blocks.VALID_ROOT)); describe("should be rejected", function(){ @@ -99,6 +99,9 @@ function test (rule, raw, expectedMessage) { if (e.uerr) { // This is a controlled error e.uerr.message.should.equal(expectedMessage); + } else if (e) { + // This is a controlled error + e.message.should.equal(expectedMessage); } else { // throw Error(e) // Display non wrapped errors (wrapped error is an error in constants.js) -- GitLab