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
We are using Markdown reporter for our Mocha tests and started having troubles with version 2.3.0 and above. There seems to be an infinite recursion in Markdown reporter:
$ NODE_ENV=test ./node_modules/.bin/mocha --reporter markdown >> docs/README.md
/home/balder/git/payments/node_modules/mocha/lib/reporters/markdown.js:40
obj = obj[key] = obj[key] || { suite: suite };
^
RangeError: Maximum call stack size exceeded
at mapTOC (/home/balder/git/payments/node_modules/mocha/lib/reporters/markdown.js:40:25)
at /home/balder/git/payments/node_modules/mocha/lib/reporters/markdown.js:42:7
at Array.forEach (native)
at mapTOC (/home/balder/git/payments/node_modules/mocha/lib/reporters/markdown.js:41:18)
at /home/balder/git/payments/node_modules/mocha/lib/reporters/markdown.js:42:7
Apparently, the issues started with commit 3f78f10, with the changes in the mapTOC function in lib/reporters/markdown.js, more precisely, deletion of callback parameter in the foreach loop:
functionmapTOC(suite,obj){varret=obj;varkey=SUITE_PREFIX+suite.title;obj=obj[key]=obj[key]||{suite: suite};suite.suites.forEach(function(){// suite param missing leads to infinite recursionmapTOC(suite,obj);});returnret;}
I have tested locally and adding the param back fixes the issue.
The text was updated successfully, but these errors were encountered:
We are using Markdown reporter for our Mocha tests and started having troubles with version 2.3.0 and above. There seems to be an infinite recursion in Markdown reporter:
Apparently, the issues started with commit 3f78f10, with the changes in the
mapTOC
function inlib/reporters/markdown.js
, more precisely, deletion of callback parameter in the foreach loop:I have tested locally and adding the param back fixes the issue.
The text was updated successfully, but these errors were encountered: