mocha-sidebar: Errors from Mocha side bar

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. 

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 14
  • Comments: 16 (3 by maintainers)

Most upvoted comments

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.

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?

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.

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 notifications@github.com 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 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.

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.

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