Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: testcase.testcase[0]._attr.time.toFixed is not a function" fails CI pipelines randomly #171

Closed
dawid-bobowski opened this issue Jun 9, 2022 · 1 comment

Comments

@dawid-bobowski
Copy link

Current behaviour:

TypeError is thrown randomly when running Cypress tests in Jenkins pipeline which fails the build before all tests are finished:

09:05:20  TypeError: testcase.testcase[0]._attr.time.toFixed is not a function
09:05:20      at /home/node/node_modules/mocha-junit-reporter/index.js:438:73
09:05:20      at Array.forEach (<anonymous>:null:null)
09:05:20      at /home/node/node_modules/mocha-junit-reporter/index.js:433:12
09:05:20      at Array.forEach (<anonymous>:null:null)
09:05:20      at MochaJUnitReporter.getXml (/home/node/node_modules/mocha-junit-reporter/index.js:417:14)
09:05:20      at MochaJUnitReporter.flush (/home/node/node_modules/mocha-junit-reporter/index.js:395:20)
09:05:20      at MochaJUnitReporter.<anonymous> (/home/node/node_modules/mocha-junit-reporter/index.js:272:10)
09:05:20      at Runner.emit (events.js:327:22)
09:05:20      at Reporter.emit (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/lib/reporter.js:333:46)
09:05:20      at ProjectBase.<anonymous> (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/lib/project-base.js:449:34)
09:05:20      at Generator.next (<anonymous>:null:null)
09:05:20      at /root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/node_modules/tslib/tslib.js:117:75
09:05:20      at new Promise (<anonymous>:null:null)
09:05:20      at Object.__awaiter (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/node_modules/tslib/tslib.js:113:16)
09:05:20      at Object.onMocha (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/lib/project-base.js:442:51)
09:05:20      at Socket.<anonymous> (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/lib/socket-base.js:213:40)
09:05:20      at Socket.emit (events.js:315:20)
09:05:20      at Socket.emitUntyped (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/typed-events.js:69:22)
09:05:20      at /root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/socket.js:428:39
09:05:20      at processTicksAndRejections (internal/process/task_queues.js:75:11)

Expected behaviour:

All of Cypress tests in Jenkins pipeline are run properly.

Cypress version:

8.3.0
It was also reported with other versions: cypress-io/cypress#18970

Possible solution:

Suggested by @halfninja in cypress-io/cypress#18970 (comment)

@DamienCassou
Copy link

I'm having the exact same issue with Cypress 10.3.

halfninja added a commit to halfninja/mocha-junit-reporter that referenced this issue Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants