mocha-sidebar icon indicating copy to clipboard operation
mocha-sidebar copied to clipboard

Errors from Mocha side bar

Open sandy081 opened this issue 5 years ago • 16 comments

image

____________________________________________________________________________
trying to searching for tests using these settings: 

    mocha path: /Users/sandy081/work/vscode/node_modules/mocha/index.js
    test files location: test/**/*.js
    files to ignore: **/.git/**/*,**/node_modules/**/*
    environmets: {}
    requires: []
    options:  {}


if you find anything wrong please change those default settings
____________________________________________________________________________
http://localhost:8887/

Error: Cannot find module 'electron'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/sandy081/work/vscode/test/electron/index.js:6:41)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at /Users/sandy081/work/vscode/node_modules/mocha/lib/mocha.js:220:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/Users/sandy081/work/vscode/node_modules/mocha/lib/mocha.js:217:14)
    at Glob (/Users/sandy081/.vscode-insiders/extensions/maty.vscode-mocha-sidebar-0.20.26/lib/worker/findtests.js:86:15)
cant get tests Error: Mocha sidebar: Process exited with code 255. See Mocha output for more info. 

sandy081 avatar May 23 '19 08:05 sandy081

So you don't want that the messages will pop up in case of errors ?

maty21 avatar May 28 '19 17:05 maty21

How does this error helps user and what does the user needs to be done to get this fixed?

sandy081 avatar May 29 '19 07:05 sandy081

The first is that you using electron as require and it was not installed . The second pop up an issue oops I'll fix it

maty21 avatar May 29 '19 13:05 maty21

@maty21 I am also running in to the cant find nyc locally and there is no setting for other path,Error: get-installed-path: module not found "nyc" in path issue is there a workaround/fix for this issue?

I am using the 0.22.2 version from the Marketplace.

cvespa avatar May 29 '19 17:05 cvespa

Try installing NYC as dev dependency or if coverage is not something that you need you can disable it from settings

On Wed, May 29, 2019, 8:49 PM Christian Vespa [email protected] wrote:

@maty21 https://github.com/maty21 I am also running in to the cant find nyc locally and there is no setting for other path,Error: get-installed-path: module not found "nyc" in path issue is there a workaround/fix for this issue?

I am using the 0.22.2 version from the Marketplace.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/maty21/mocha-sidebar/issues/181?email_source=notifications&email_token=ABH6POKKZ5KYD3J2ZSKCSXDPX262TA5CNFSM4HO3BFZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWQD4BY#issuecomment-497040903, or mute the thread https://github.com/notifications/unsubscribe-auth/ABH6POLG2DBDW26IDVHJDNDPX262TANCNFSM4HO3BFZA .

maty21 avatar May 29 '19 18:05 maty21

Same issue here. AFAICS, nyc is included in the extension (I can see a ~/.vscode/extensions/maty.vscode-mocha-sidebar-0.22.2/node_modules/nyc), so there should be no need to add it as dev dependency to every single project again?

alexkli avatar Aug 20 '19 21:08 alexkli

Is this project dead? I'm exploring for a mocha comparable extension to some Jest stuff we use. This seems pretty inactive and this extension doesn't work. Installing nyc just to see this thing in action didn't work either.

Or, any better extensions to use?

bogeylnj avatar Oct 09 '19 16:10 bogeylnj

I too am having this problem.

jkaldon avatar Nov 28 '19 16:11 jkaldon

I too am having this problem

trukhinyuri avatar Jan 24 '20 12:01 trukhinyuri

Any updates about this issue?

imjaroiswebdev avatar Feb 08 '20 03:02 imjaroiswebdev

This worked for me...

i looked for nyc binary path with which nyc and then in mocha extension setting i set the path for the setting Nyc Path.

imjaroiswebdev avatar Feb 08 '20 04:02 imjaroiswebdev

I am facing the same issue in Windows. Just installed VS Code and this extension.

side-bar: cant find nyc locally and there is no setting for other path,Error: get-installed-path: module not found "nyc" in path c:\Users\Orekav\Git\TestingNodeWithMocha\Module2\Demo\node_modules\nyc

orekav avatar Mar 25 '20 08:03 orekav

I am also having this issue on Windows. Adding this setting to my settings.json fixes it (thanks @imjaroiswebdev):

"mocha.nycPath": "~/.vscode/extensions/maty.vscode-mocha-sidebar-*/node_modules/nyc/bin/nyc"

It sets the mocha.nycPath setting to the nyc executable which is downloaded by this extension.

That path is in UNIX format, not Windows format, so I am guessing that it would work on Linux and MacOS too.

Since this fixes the problem, it appears that the problem is that the default value for this setting is incorrect. I am unfamiliar with building vscode extensions, so I could be wrong, but that is my best guess.

GreenRaccoon23 avatar Jun 24 '20 17:06 GreenRaccoon23

Still doesnt work.

cgarrovillo avatar Oct 28 '21 21:10 cgarrovillo

Not working

kalanamt avatar Jan 12 '22 23:01 kalanamt

After digging a little bit I realised that there is another extension that just works: https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-mocha-test-adapter and seems to be actively maintained.

ssbarnea avatar Jan 19 '22 18:01 ssbarnea