You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ node example.js
1
~/src/github.com/power-assert-js/power-assert/example.js:12
console.log(capt(++capt(capt(counter).count)));
^
ReferenceError: Invalid left-hand side expression in prefix operation
at Object.<anonymous> (~/src/github.com/power-assert-js/power-assert/example.js:12:20)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
$
capt function is what power-assert is doing internally, so when I tried to capture UpdateExpression like ++foo, it always result in ReferenceError.
Since test tool should not change behavior of SUT (System Under Test), I gave up supporting UpdateExpression.
Sorry for inconvenience. I'll write about this limitation to FAQ section in REAME. Thanks!
Activity
[-]Incorrect increment/decrement assertion messages[/-][+]Incomplete increment/decrement assertion messages[/+]twada commentedon Nov 9, 2015
Hi, thank you for reporting.
Unfortunately, it's a limitation of power-assert. I cannot support
UpdateExpressionsince it causesReferenceError.Let me explain. Given
example.js,results in
ReferenceErrorwhen executed.captfunction is what power-assert is doing internally, so when I tried to captureUpdateExpressionlike++foo, it always result inReferenceError.Since test tool should not change behavior of SUT (System Under Test), I gave up supporting
UpdateExpression.Sorry for inconvenience. I'll write about this limitation to FAQ section in REAME. Thanks!
docs(README): add `Incomplete increment/decrement assertion messages?…
falsandtru commentedon Nov 9, 2015
I understand, thanks!
[-]Incomplete increment/decrement assertion messages[/-][+]Cannot capture UpdateExpression like ++foo[/+]