maty21 / mocha-sidebar

Mocha side bar viewer that allows you to run Mocha tests from side bar menu and view results can run each level hierarchy from all tests to a single test(and each describer of course)
MIT License
190 stars 61 forks source link

Requiring esm doesn't do anything #154

Open Avocher opened 6 years ago

Avocher commented 6 years ago

Description

It seems that requiring esm in the sidebar config doesn't do anything while it works fine from console. https://github.com/standard-things/esm

   trying to searching for tests using these settings: 

    mocha path: mocha
    test files location: ./esnext/**/*.spec.js
    files to ignore: **/.git/**/*,**/node_modules/**/*
    environmets: {}
    requires: ["esm"]
    options:  {}

   if you find anything wrong please change those default settings
____________________________________________________________________________
********/Cluster.spec.js:1
(function (exports, require, module, __filename, __dirname) { import { PlanarCluster } from "./Cluster.js";
                                                                     ^

Steps to Reproduce

  1. Install esm: npm i --save esm
  2. Paste into file with a test:
    import * as path from "path";
  3. Run test through sidebar

Same example will run fine from console: mocha -r esm esnext/**/*.spec.js

Expected Results

Shouldn't crash

Actual Results

Crashes because requiring esm doesn't seem to do anything

Versions

OS version

naholyr commented 6 years ago

Same here, did you find a workaround?

Seasonley commented 5 years ago

I create .babelrc like this

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": "> 0.25%, not dead"
      },
    ]
  ],
  "exclude": "node_modules/**",
}

then the mocha-sidebar can work .

But when it paused on breakpoint , that line didn't highlighted, and debug-siderbar tell me that file was skipped by smartStep.

amirzahavi commented 4 years ago

+1

wangyu142857 commented 3 years ago

+1