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

[fix] #1037 Local tests fix

parent 113feaee
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ const should = require('should'); ...@@ -4,7 +4,7 @@ const should = require('should');
const parsers = require('duniter-common').parsers; const parsers = require('duniter-common').parsers;
const indexer = require('../../app/lib/indexer').Indexer const indexer = require('../../app/lib/indexer').Indexer
const LOCAL_RULES = require('../../app/lib/rules/local_rules').LOCAL_RULES_FUNCTIONS 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 blocks = require('../data/blocks.js');
const parser = parsers.parseBlock; const parser = parsers.parseBlock;
const Block = require('duniter-common').document.Block const Block = require('duniter-common').document.Block
...@@ -25,7 +25,7 @@ const conf = { ...@@ -25,7 +25,7 @@ const conf = {
describe("Block local coherence", function(){ 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(){ describe("should be rejected", function(){
...@@ -99,6 +99,9 @@ function test (rule, raw, expectedMessage) { ...@@ -99,6 +99,9 @@ function test (rule, raw, expectedMessage) {
if (e.uerr) { if (e.uerr) {
// This is a controlled error // This is a controlled error
e.uerr.message.should.equal(expectedMessage); e.uerr.message.should.equal(expectedMessage);
} else if (e) {
// This is a controlled error
e.message.should.equal(expectedMessage);
} else { } else {
// throw Error(e) // throw Error(e)
// Display non wrapped errors (wrapped error is an error in constants.js) // Display non wrapped errors (wrapped error is an error in constants.js)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment