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
Describe the bug
Test runs appear to stall at the end when using this reporter.
I'm upgrading from v3.0.2 to 3.1.0, it appears this new regex used in cleanCode chokes on certain strings:
.replace(/^(?:.|\s)*?(?:{|=>) *\n?(?:\(|{)?/,'')// replace function declaration
Code Reproduce
I pulled out the regex from cleanCode and used a sample string to demonstrate the issue. Run the following lines in a node session and notice the str.replace call does not complete.
>letstr="\"Failure type was error - return eventSpies.validationError.dispatch.lastCall.args[0].errorResponse.type === 'error';\"\\"Failure code was service error - return eventSpies.validationError.dispatch.lastCall.args[0].errorResponse.code === 4;\\"Blackout validator failed - return eventSpies.validationError.dispatch.lastCall.args[0].errorResponse.validatorType === 'top.validator.blackout';\"\\"Validation failed once - return eventSpies.validationError.dispatch.calledOnce;\"\\"Content failed from error - return eventSpies.contentError.dispatch.calledOnce;\"\\"Content state is error - return player.model().contentState() === TOP.player.ContentState.Error;\"">str=str.replace(/\r\n|[\r\n\u2028\u2029]/g,'\n').replace(/^\uFEFF/,'').replace(/^(?:.|\s)*?(?:{|=>) *\n?(?:\(|{)?/,'')
Expected behavior
String processing should complete.
Environment (please complete the following information):
Platform macOS 10.14
mochawesome version 3.1.0
mocha (or other test library) 5.2.0
Node version 10.12.0 (also observed on 9.5.0)
Additional context
Our test implementation overrides the test bodies with formatted versions of our assertions which is why the sample string used in the example doesn't look like a valid function.
The text was updated successfully, but these errors were encountered:
Describe the bug
Test runs appear to stall at the end when using this reporter.
I'm upgrading from v3.0.2 to 3.1.0, it appears this new regex used in
cleanCode
chokes on certain strings:mochawesome/src/utils.js
Line 56 in e176d7f
Code Reproduce
I pulled out the regex from
cleanCode
and used a sample string to demonstrate the issue. Run the following lines in a node session and notice thestr.replace
call does not complete.Expected behavior
String processing should complete.
Environment (please complete the following information):
Additional context
Our test implementation overrides the test bodies with formatted versions of our assertions which is why the sample string used in the example doesn't look like a valid function.
The text was updated successfully, but these errors were encountered: