Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Herbert VonChoucroute
    @benquinteros_twitter have you installed nyc in your local repo ?
    Otherwise if you don't need code coverage i guess that you could simply disable the coverage in mocha-sidebar config
    Can someone explain me why a test is shown red in the sidebar but on run with the shell the test pass
    Ben Quinteros
    @Fankohr_gitlab I have not, thanks i'll have a look at that config!
    Arpit Yadav
    I just installed the mocha sidebar. But I cant run the tests from it. Coverage and debug os working perfectly..
    Kevin Szuchet
    I just installed the mocha sidebar extension and use "mocha.files.glob": "{server,App_Data}/*/.spec.js" on the settings. I am trying to use it with javascript and babel-register. What I am missing?

    I've been trying multiple times to get mocha sidebar to run with my current setup but i'm struggling to get it to detect tests and to run.
    My project is using rollup to compile typescript to javascript.

    my tests runs fine when I run the npm run test-unit that looks like this
    rollup -c rollup.test-unit-config.js && mocha dist/test-unit.bundle.js -R mocha-pretty-spec-reporter

    in the sideBar-test output i'm currently getting an exception about exporting a method with SyntaxError: Unexpected token export

    I would love if anyone could assist me in getting it up and running :)

    I changed settings to the following "mocha.files.glob": "dist/**/test*bundle.js" but now i'm getting a 'chai' is undefined in cjs
    Alan Campos
    Hello, I am having issues trying to get Sidebar working on VSCode. Output message:
    trying to searching for tests using these settings: 
        mocha path: /Users/campos/Documents/Development/Web/pangea/server/node_modules/mocha/index.js
        test files location: test/**/*.test.ts
        files to ignore: **/.git/**/*,**/node_modules/**/*,**/src/**/*,
        environmets: {}
        requires: ["ts-node/register"]
        options:  {"compilers":{"ts":"ts-node/register"}}
    if you find anything wrong please change those default settings
    Error: spec could not be read at /Users/campos/.vscode/extensions/maty.vscode-mocha-sidebar-0.22.2/lib/worker/src/docs/swagger/swagger.yaml
        at new OpenAPIFramework (/Users/campos/Documents/Development/Web/pangea/server/node_modules/express-openapi-validator/dist/framework/index.js:44:19)
    I use Typescript and Electron the base project dont use commonjs but the test's have there own tsconfig.json with commonjs but mocha-sidebar read the main tsconfig.json and cant detect the test files right. This is my mocha.opts: --require ts-node/register --require test/tshook.js test/**/*.ts
    Hi guy I was in a vacation
    I will try my best to find a solution for your issues :)
    Sherry Ummen
    Hi, I wonder if someone has encountered a problem, where I am able to click on debug button and I am able to debug the unit test, but then i press the execute button (green play button) then nothing happens. any idea why?
    Sherry Ummen
    And I am not using Typescript, its just plain nodejs app (just starting to learn nodejs :) )
    Sherry Ummen

    Ok so here is the thing, if ḿy test is inside describe like this
    describe('console log testing', () => {
    it('should log hello world', () => {
    expect(console.log).to.have.been.calledWith('Hello World');

    then everythign works fine. If I just keep the 'it' block then as I said the green button does not execute the test.

    it('should log hello world', () => {
    expect(console.log).to.have.been.calledWith('Hello World');

    if there any particular reason for this behaviour?

    Hi All, looks like running a test in debug mode with TS fails to execute due to deprecated --compilers parameter?
    × ERROR: --compilers is DEPRECATED and no longer supported.
              See for migration information.
    Antonio Halužan
    Hello everyone. I am unable to use coverage button in sidebar. What should I configure in order to use it?
    pls add support for .mocharc or mocha.opts without it it cant read my tests that makes it for me useless :/
    Tural Sadık
    great product, was planning to develop something similar. thanks for hard work


    I can't get the coverage feature to work: I click on the umbrella icon and the status bar stays indefinitely in "coverage: progress".

    The extension was initially complaining about nyc so I npm-installed it.

    Hi All, Any specific steps to use with electron projects?, I could not able to load any tests bz error in loading app object references in test cases
    Geoff Corey
    Trying to debug cant get tests Error: Mocha sidebar: Process exited with code 1. See Mocha output for more info. . My project has package.json in src/ and test in src/tests no other issues including nyc but mocha-sidebar cannot seem to find the tests { "editor.tabSize": 2, "files.insertFinalNewline": true, "files.trimTrailingWhitespace": true, "files.autoSave": "afterDelay", "mocha.files.glob": "src/tests/**/*.test.js", "mocha.path": "src/node_modules/mocha/bin", "mocha.nycPath": "src", "mocha.logVerbose": true }
    Antonio Halužan
    Is anyone reading this?
    Yadunandan Batchu
    anyone online?
    Hi everyone, I am new to Sidebar and having from trouble installing and getting it set up. I keep seeing this error the settings fields all have "undefined" in them and changing them just shows the error:
    Unable to write to User Settings because mocha.files.glob is not a registered configuration.
    Mocha-sidebar makes VSCode running very slow, anyone has this problem as well?
    Pascal GANAYE
    The bar is working OK for me. I can see the test that succeed or fail.
    Each time I change my source, I have to click the ▶ button, is that normal? I was sort of expecting the bar to be in watch mode .
    To be clear, I can see my test going yellow in the side bar when I change it but it won't go green or red even if I save.
    Sebastian Bolek

    Hi Guys,

    I ve got total 6 tests which are working correct. I can run them by sidebar plugin, coverage, debug etc. Everything is working but any test is on a list under Tests accordeon. What can be a problem guys? (I see all from sidebar is woking on bar on bottom - showing passed tests or changing status of coverage)

    My output:

    mocha path: /home/hajtuj/Projects/Web/tic-tac-toe/node_modules/mocha/index.js
        test files location: test/**/*.test.ts
        files to ignore: **/.git/**/*,**/node_modules/**/*
        environmets: {}
        requires: ["ts-mocha"]
        options:  {}
    Sebastian Bolek
    @hajtuJ @maty21 ?
    Anton Ilyin
    hello. How can I pass arguments to mocha-sidebar? I mean that i run my tests with arguments (mocha test/integration --email --password asdasdasd ....)
    Vincent Pillinger
    Hi, I was under the impression that this extension can show coverage results visually in the editor. Is this not something that it does?

    Hi, I'm unable to debug tests - I'm getting error: "must provide pattern" when I'm trying to Debug Item.
    But when I click on Run Item it works ok.

    Error: must provide pattern
        at new GlobSync (/Users/nadavgabay/inx/backoffice-server/node_modules/glob/sync.js:31:11)
        at Function.globSync [as sync] (/Users/nadavgabay/inx/backoffice-server/node_modules/glob/sync.js:26:10)
        at Object.lookupFiles (/Users/nadavgabay/inx/backoffice-server/node_modules/mocha/lib/utils.js:517:20)
        at args.forEach.arg (/Users/nadavgabay/inx/backoffice-server/node_modules/mocha/bin/_mocha:531:22)
        at Array.forEach (<anonymous>)
        at Object.<anonymous> (/Users/nadavgabay/inx/backoffice-server/node_modules/mocha/bin/_mocha:528:6)
        at Module._compile (internal/modules/cjs/loader.js:775:14)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
        at Module.load (internal/modules/cjs/loader.js:653:32)
        at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
        at Function.Module._load (internal/modules/cjs/loader.js:585:3)
        at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
        at startup (internal/bootstrap/node.js:283:19)
        at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

    This in the mocha part in settings.json:

    "mocha.files.glob": "test/**/*.test.js",
      "mocha.logVerbose ": true,
      "mocha.env": {
        "NODE_ENV": "test",
        "NODE_CONFIG_DIR": "/opt/inx/config/backoffice-server/"
      "mocha.coverage": {
        "enable": false
      "mocha.options": {
        "timeout": "30000",
        "exit": ""
      "mocha.requires": [
      "mocha.runTestsOnSave": "false",
      "mocha.parallelTests": 1,
    Garth Tissington
    I'm just trying to learn to use mocha side bar. It seems to run OK but all tests only show yellow stauts; Never red or green? What does yellow even mean?
    Oh, run the test is running it does show "Refresh" icon But then always yellow.
    im trying to use mocha sidebar but I am getting this error when I try to run all tests.
    Failed to run tests due to Cannot read property 'split' of undefined
    Failed to find Node.js installation due to Cannot read property 'split' of undefined
    here is my .vscode/settings.json
    "mocha.options": {},
    "mocha.env": {},
    "mocha.files.glob": "test//*.js",
    "mocha.files.ignore": [
    "mocha.node_options": [],
    "mocha.subfolder": "",
    "mocha.requires": [],
    "key": "cmd+k r",
    "command": "mocha.runAllTests",
    "mocha.logVerbose": true
    Is souce-maps supported in Mocha sidebar? I'm using "mocha.requires": ["source-map-support/register"] in the settings and "mocha.files.glob": "tests/**/*.js", and I only get the javascript files to show up in the sidebar. I'm using the fable compiler to transpile from F#. If I set mocha.files.globto tests/**/*.fsinstead nothing shows in the sidebar.
    I have no side-bar after installing the extension. Also no code coverage displayed in my js files. I do see my tests having a yellow mark, and after running a green one (if they pass), as well as running works with >mocha: Run All Test. I also see 25 tests passed 0 failed in the status bar and sideBar-test and sideBar-coverage show results.
    I tried to add "mocha.showInExplorer": true but get no errors at all.
    I had an error that mentioned nyc the first time i installed the extension, but i installed nyc as dev denepency since and haven't seen it since.
    I'm at loss


    [maty.vscode-mocha-sidebar]: Command mocha-maty.runAllTests appears multiple times in the commands section.
    abstractExtensionService.ts:396 [maty.vscode-mocha-sidebar]: A view with id mocha is already registered.

    But i'm not aware of any other mocha extensions or views i have.

    Guess this channel is pretty dead

    I cant get my test run in mocha side bar. looks like it starts executing but it cant find my config module module which is outside my tests folder.
    To run it from npm script as npm run test, I have to have below command in package.json:

    "test": "cross-env NODE_ENV=test NODE_PATH=. nyc --reporter=html --reporter=text-summary mocha --recursive --exit"

    I tried to config mocha ext as below
    "mocha.logVerbose": true,
    "NODE_PATH": ".",
    "mocha.files.glob": "test//*.js",
    "mocha.files.ignore": "

    I think I will need to use cross-env but dont know where should I mention that.
    Am I doing anything wrong?

    Daniel Tucker
    Hello. I am interested in using this tool but can't seem to get my tests loaded. I currently load the tests in my package.json file with ts-mocha --paths -p tsconfig.json How do I get the settings for this extension to take the tsconfig.json?

    Hi, so I am unable to get this sidebar to run...
    here is how my package.json looks like
    "test": "mocha -r ts-node/register test/**/*.spec.ts --timeout 60000"
    here is how my .mocharc.yml looks like

      - 'test/**/*.ts'
    require: 'ts-node/register'
    retries: 1
    slow: 75
    sort: false
    timeout: false # same as "no-timeout: true" or "timeout: 0"
    logVerbose: true

    Any thoughts what is missing in the configuration file. I get error Error while loading tests