-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
area: parallel modeRegarding parallel modeRegarding parallel modearea: reportersinvolving a specific reporterinvolving a specific reportertype: buga defect, confirmed by a maintainera defect, confirmed by a maintainer
Description
Prerequisites
- Checked that your issue hasn't already been filed by cross-referencing issues with the
faqlabel - Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
- 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
- Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with:
node node_modules/.bin/mocha --version(Local) andmocha --version(Global). We recommend that you not install Mocha globally.
Description
Failures in Before and BeforeAll hooks causes xunit & json report generation to fail in parallel mode
Steps to Reproduce
- On any test suit with a
beforeEachorbeforehook introduce an intentional failure in the hook - Run the test suite with the flag
--paralleland--reporter jsonor--reporter xunit
Expected behavior:
- Report is generated successfully
Actual behavior:
-
Report is not generated and the following error is thrown
-
When using
jsonreporter
......\node_modules\mocha\lib\reporters\json.js:89
fullTitle: test.fullTitle(),
^
TypeError: test.fullTitle is not a function
at clean (C:\Dev\reacts-api-tests\node_modules\mocha\lib\reporters\json.js:89:21)
at Array.map (<anonymous>)
at ParallelBufferedRunner.<anonymous> (C:\Dev\reacts-api-tests\node_modules\mocha\lib\reporters\json.js:63:26)
at Object.onceWrapper (events.js:421:28)
at ParallelBufferedRunner.emit (events.js:327:22)
at ParallelBufferedRunner.EventEmitter.emit (domain.js:467:12)
at C:\Dev\reacts-api-tests\node_modules\mocha\lib\nodejs\parallel-buffered-runner.js:347:14
at processTicksAndRejections (internal/process/task_queues.js:93:5)
- when using
xunitreporter
....\node_modules\mocha\lib\reporters\xunit.js:159
classname: test.parent.fullTitle(),
^
TypeError: test.parent.fullTitle is not a function
at XUnit.test (C:\Dev\reacts-api-tests\node_modules\mocha\lib\reporters\xunit.js:159:28)
at C:\Dev\reacts-api-tests\node_modules\mocha\lib\reporters\xunit.js:107:12
at Array.forEach (<anonymous>)
at ParallelBufferedRunner.<anonymous> (C:\Dev\reacts-api-tests\node_modules\mocha\lib\reporters\xunit.js:106:11)
at Object.onceWrapper (events.js:421:28)
at ParallelBufferedRunner.emit (events.js:327:22)
at ParallelBufferedRunner.EventEmitter.emit (domain.js:467:12)
at C:\Dev\reacts-api-tests\node_modules\mocha\lib\nodejs\parallel-buffered-runner.js:347:14
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Reproduces how often: 100%
Versions
- node version
v14.15.4 - mocha version
8.3.2 - .\node_modules.bin\mocha version
8.3.2 - Your operating system
- name and version: Windows 10
- architecture (32 or 64-bit): 64-bit
- Your shell (e.g., bash, zsh, PowerShell, cmd): PowerShell
- Your browser and version (if running browser tests): N/A
- Any third-party Mocha-related modules (and their versions): N/A
- Any code transpiler (e.g., TypeScript, CoffeeScript, Babel) being used (and its version): ts-node v9.1.1
Additional Information
Metadata
Metadata
Assignees
Labels
area: parallel modeRegarding parallel modeRegarding parallel modearea: reportersinvolving a specific reporterinvolving a specific reportertype: buga defect, confirmed by a maintainera defect, confirmed by a maintainer