Skip to content
This repository has been 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

Open
anandprasathm opened this issue Sep 21, 2021 · 0 comments

Comments

@anandprasathm
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant