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

Could not load reporter by name #1192

Closed
NoNameProvided opened this issue Jan 15, 2018 · 6 comments
Closed

Could not load reporter by name #1192

NoNameProvided opened this issue Jan 15, 2018 · 6 comments
Assignees
Labels
type: unexpected behavior User expected result, but got another
Milestone

Comments

@NoNameProvided
Copy link

  • Operating System: MacOS High Sierra
  • Cypress Version: 1.4.1
  • Browser Version: Chrome latest

Is this a Feature or Bug?

Bug.

Current behavior:

When specifying any custom reporter (tried with mocha-multi-reporters and mochawesome ) in cypress.json, cypress fails with

Could not load reporter by name: mocha-multi-reporters

We searched for the reporter in these paths:

- /Users/redacted/redacted/ui-test-poc/mocha-multi-reporters
- /Users/redacted/redacted/ui-test-poc/node_modules/mocha-multi-reporters

However, the reporter is installed and can be found at the specified path:

/Users/redacted/redacted/ui-test-poc/node_modules/mocha-multi-reporters

Desired behavior:

Cypress loads the reporter successfully

How to reproduce:

  • make a starter project

  • run npm i mocha-multi-reporters --save-dev

  • add the following cypress.json file:

    {
      "videoRecording": false,
      "reporter": "mocha-multi-reporters",
      "reporterOptions": {
        "configFile": "multi-reporter-config.json"
      }
    }
    
    
  • run npx cypress run

Test code:

n/a

Additional Info (images, stack traces, etc)

n/a

@NoNameProvided NoNameProvided changed the title Could not load any reporter by name Could not load reporter by name Jan 15, 2018
@NoNameProvided
Copy link
Author

NoNameProvided commented Jan 15, 2018

Update: mocha was not installed, that's the reason why it failed.

Shouldn't mocha be auto-installed with cypress? Also, the error messages should indicate mocha is missing instead of the reporter.

@brian-mann brian-mann added the type: unexpected behavior User expected result, but got another label Jan 16, 2018
@brian-mann brian-mann self-assigned this Jan 16, 2018
brian-mann added a commit that referenced this issue Mar 4, 2018
@brian-mann brian-mann added this to the 3.0.0 milestone Mar 4, 2018
@Aftabnack
Copy link
Contributor

I ran into the same problem with mochawesome. The error message on the terminal is not helpful.

screenshot from 2018-03-13 14-13-31

Thankfully you had a section in your reporters documentation specifically about mochawesome. Can the error thrown on terminal be little more descriptive?

@defel
Copy link

defel commented May 4, 2018

FYI: I had to install mocha as a dev-dependency - peer-dependency didnt work

Context: I use lerna and yarn as a monorepo, also had to add cypress, mocha, and mochawesome to nohoist.

package.json on root:

  "workspaces": {
    "packages": ["packages/*"],
    "nohoist": [
      "**/mochawesome",
      "**/mochawesome/**",
      "**/mocha",
      "**/mocha/**",
      "**/cypress",
      "**/cypress/**"
    ]
  }

@NoNameProvided
Copy link
Author

I had to install mocha as a dev-dependency - peer-dependency didn't work

Peer dependencies are not installed when running npm i.

If any of you have any issue, please consider opening a new issue if you still experience any problem. Commenting on closed issues is not a good way to get attention to your problem.

@jennifer-shehane jennifer-shehane added stage: pending release and removed stage: pending release stage: investigating Someone from Cypress is looking into this stage: needs investigating Someone from Cypress needs to look at this stage: ready for work The issue is reproducible and in scope labels May 24, 2018
@brian-mann
Copy link
Member

Released in 3.0.0.

@ojha-ravi
Copy link

I ran into the same problem with mochawesome. @defel 's solution worked for me.
Thanks @defel .

@cypress-io cypress-io locked as resolved and limited conversation to collaborators May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: unexpected behavior User expected result, but got another
Projects
None yet
Development

No branches or pull requests

6 participants