Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

MODULE NOT FOUND - @mochajs json-file-reporter even though it is not included on package.json #61

@anandprasathm

Description

@anandprasathm

Hi,

I have created a mocha project and included the spec file '.mocharc.json' and included the reporter '"@mochajs/json-file-reporter'.

My .mocharc.json looks like below
{
"spec": "test/**/test1.js",
"reporter": "@mochajs/json-file-reporter",
"reporter-option": [
"output=filename.json"
]
}

Scripts on the package.json as below
"scripts": {
"test": "mocha"
},

When i given npm test, it worked fine.

Then again, i ve created a new project and i didn't install/use any reference of '@mochajs/json-file-reporter' (not even have any .mocharc.json file) and specified the test directly on the scripts.

When i run this test from the new project, i am getting the Error MODULE NOT FOUND for @mochajs json-file-reporter

When i install this package, i am getting the error like 'Couldn't find any files matching pattern "test/**/test1.js"'.

I am not sure why my tests are not getting picked up from the current project and why this is always referring to the first one.

Has anyone come across this issue on Mocha?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions