mocha-community / json-file-reporter

JSON file reporter for Mocha
https://www.npmjs.com/package/@mochajs/json-file-reporter
MIT License
3 stars 9 forks source link

Mocha 8.2.1 started causing an error for json-file-reporter #47

Open NazarYermolenko opened 4 years ago

NazarYermolenko commented 4 years ago

The following error message started appearing after updating Mocha from 8.1.3 to 8.2.1

/home/newfire/Desktop/work/qa-ui/node_modules/@mochajs/json-file-reporter/src/index.js:75 fullTitle: test.fullTitle(), ^ TypeError: test.fullTitle is not a function at clean (/home/newfire/Desktop/work/qa-ui/node_modules/@mochajs/json-file-reporter/src/index.js:75:21) at Array.map (<anonymous>) at ParallelBufferedRunner.<anonymous> (/home/newfire/Desktop/work/qa-ui/node_modules/@mochajs/json-file-reporter/src/index.js:48:26) at Object.onceWrapper (events.js:420:28)

munierujp commented 3 years ago

@NazarYermolenko Sorry for the delay in replying. In my environment, that problem did not occur. Could you show me the repository or source codes when the problem is reproducible?

NazarYermolenko commented 3 years ago

The issue appears when all tests failing...

/home/newfire/Desktop/work/qa-api/node_modules/@mochajs/json-file-reporter/src/index.js:75
    fullTitle: test.fullTitle(),

TypeError: test.fullTitle is not a function
    at clean (/home/newfire/Desktop/work/qa-api/node_modules/@mochajs/json-file-reporter/src/index.js:75:21)
    at Array.map (<anonymous>)
    at ParallelBufferedRunner.<anonymous> (/home/newfire/Desktop/work/qa-api/node_modules/@mochajs/json-file-reporter/src/index.js:48:26)
    at Object.onceWrapper (events.js:420:28)
    at ParallelBufferedRunner.emit (events.js:326:22)
    at ParallelBufferedRunner.EventEmitter.emit (domain.js:483:12)
    at /home/newfire/Desktop/work/qa-api/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js:347:14
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
NazarYermolenko commented 3 years ago

Or when the setup hook failing, I mean if the test has a before hook and the hook fails, the following error message appears Then an instance of the test isn't creating and we got the error. The resolution of the issue is throwing errors from setup hooks to the test, I mean it's necessary to initiate test instance before hooks execution. @munierujp