Fix assertion.
This commit is contained in:
parent
e2aaefa7df
commit
6b75bbbc00
@ -74,7 +74,7 @@ Linkify =
|
|||||||
|
|
||||||
if Linkify.regString.test word
|
if Linkify.regString.test word
|
||||||
links.push Linkify.makeRange node, endNode, index, length
|
links.push Linkify.makeRange node, endNode, index, length
|
||||||
<%= assert('word is links[links.length-1].toString()') %>
|
<%= assert('.tests_enabled', 'word is links[links.length-1].toString()') %>
|
||||||
|
|
||||||
break unless test.lastIndex and node is endNode
|
break unless test.lastIndex and node is endNode
|
||||||
|
|
||||||
|
|||||||
@ -161,8 +161,8 @@ obj.html = function(template) {
|
|||||||
return `(innerHTML: ${output})`;
|
return `(innerHTML: ${output})`;
|
||||||
};
|
};
|
||||||
|
|
||||||
obj.assert = function(statement) {
|
obj.assert = function(flagFile, statement) {
|
||||||
if (!obj.tests_enabled) return '';
|
if (!readJSON(flagFile)) return '';
|
||||||
return `throw new Error 'Assertion failed: ' + ${constExpression(statement)} unless ${statement}`;
|
return `throw new Error 'Assertion failed: ' + ${constExpression(statement)} unless ${statement}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user