Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

side-bar: cant get tests Error: Mocha sidebar: Process exited with code 4294967295. #209

Open
2 tasks
DaniGTA opened this issue Nov 22, 2019 · 1 comment
Open
2 tasks

Comments

@DaniGTA
Copy link

DaniGTA commented Nov 22, 2019

Description

Error thrown when trying to debug mocha:

import { deepEqual } from 'assert';
       ^

SyntaxError: Unexpected token {
    at Module._compile (internal/modules/cjs/loader.js:720:22)
    at Module.m._compile (d:\GitHub\listManager\node_modules\ts-node\src\index.ts:530:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:788:10)
    at Object.require.extensions.<computed> [as .ts] (d:\GitHub\listManager\node_modules\ts-node\src\index.ts:533:12)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at d:\GitHub\listManager\node_modules\mocha\lib\mocha.js:334:36
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (d:\GitHub\listManager\node_modules\mocha\lib\mocha.js:331:14)
    at c:\Users\danig\.vscode-insiders\extensions\maty.vscode-mocha-sidebar-0.22.2\lib\worker\findtests.js:86:15
    at f (c:\Users\danig\.vscode-insiders\extensions\maty.vscode-mocha-sidebar-0.22.2\node_modules\once\once.js:25:25)
    at Glob.<anonymous> (c:\Users\danig\.vscode-insiders\extensions\maty.vscode-mocha-sidebar-0.22.2\node_modules\glob\glob.js:151:7)
    at Glob.emit (events.js:203:13)
    at Glob._finish (c:\Users\danig\.vscode-insiders\extensions\maty.vscode-mocha-sidebar-0.22.2\node_modules\glob\glob.js:197:8)
cant get tests Error: Mocha sidebar: Process exited with code 4294967295. See Mocha output for more info. 

Steps to Reproduce

I dont know how to reproduce it.

Expected Results

List my typescript test in the sidebar. Like the command "npm test" or "mocha" both works on my side.

Actual Results

Gives a error.

Settings file

    "mocha.runTestsOnSave": "true",
    "mocha.options": {
        "opts": "./test/mocha.opts"
    },

Mocha opts file:

--require ts-node/register
--require test/tshook.js
test/**/*.ts

tshook.js file (tests use another tsconfig):

// eslint-disable-next-line no-undef
require('ts-node').register({
	project: 'test/tsconfig.json',
})

tsconfig.json:

{
    "compilerOptions": {
        "outDir": "./dist/",
        "target": "esnext",
        "module": "commonjs",
        "moduleResolution": "node",
        "importHelpers": true,
        "sourceMap": true,
        "experimentalDecorators": true,
        "esModuleInterop": true,
        "resolveJsonModule": true,
        "allowSyntheticDefaultImports": true,
        
        "lib": [
            "dom",
            "esnext",
            "es6",
            "es7",
            "dom.iterable",
            "esnext.array"
        ],
        "rootDirs": [
            "src"
        ]
    },
    "include": [
        "../src/**/*",
        "./**/*"
    ],
    "compileOnSave": false
}

Versions

  • VScode: v1.41
  • Mocha SideBar: v0.22.0
  • Node Version: v12.13.1

OS version

  • Linux
  • Mac
  • [ x] Windows

Example for reproducing

I give my repo as example when this issue is not easy to fix.

@DaniGTA DaniGTA changed the title side-bar: cant get tests Error: Mocha sidebar: Process exited with code 4294967295. See Mocha output for more info. side-bar: cant get tests Error: Mocha sidebar: Process exited with code 4294967295. Nov 22, 2019
@crystalfp
Copy link

The message side-bar: cant get tests Error: Mocha sidebar: Process exited with code 4294967295. See Mocha output for more info. means mocha cannot compile the test code. Although a better message should be implemented, the problem is the compilation error.

I cannot reproduce, but I don't have --require test/tshook.js nor "mocha.options". In my settings.json I have only:

		"mocha.files.glob": "tests/**/*.test.ts",
		"mocha.requires": [
			"ts-node/register",
			"source-map-support/register"
		],

Hope it helps
mario

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

No branches or pull requests

2 participants