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

Can't see any test in the Test Explorer UI #198

Open
Y0me opened this issue Mar 19, 2022 · 2 comments
Open

Can't see any test in the Test Explorer UI #198

Y0me opened this issue Mar 19, 2022 · 2 comments

Comments

@Y0me
Copy link

Y0me commented Mar 19, 2022

My project looks like :
package.json

{
  "type": "module",
  "scripts": {
    "test": "mocha"
  },
  "devDependencies": {
    "@types/chai": "^4.3.0",
    "@types/mocha": "^9.1.0",
    "chai": "^4.3.6",
    "mocha": "9.2.2",
    "ts-node": "^10.7.0",
    "typescript": "^4.6.2"
  },
  "mocha": {
    "loader": "ts-node/esm --no-warnings=ExperimentalWarning",
    "diff": true,
    "spec": "./tests/*.ts",
    "recursive": true,
    "timeout": 3000,
    "ui": "bdd"
  }
}

.tsconfig.json

{
    "compilerOptions": {
        "target": "ESNext",
        "module": "ESNext",
        "moduleResolution": "node",
        "esModuleInterop": true,
        "sourceMap": true,
    }
}

.vscode/settings.json

{
    "mochaExplorer.logpanel": true,
    "mochaExplorer.nodeArgv": [
        "--loader=ts-node/esm",
        "--no-warnings=ExperimentalWarning",
        "--experimental-specifier-resolution=node"
    ],
}

The tests run fine when using npm run test.
But in the test explorer UI got an empty list.

Here is the output of the Mocha Explorer Log :

[2022-03-19 00:04:33.707] [INFO] Test Explorer found
[2022-03-19 00:04:33.707] [INFO] Creating adapter for d:\Repository\Test
[2022-03-19 00:04:33.708] [INFO] Registering adapter for d:\Repository\Test
[2022-03-19 00:04:33.709] [INFO] Loading test files of d:\Repository\Test
[2022-03-19 00:04:33.710] [INFO] Initialization finished
[2022-03-19 00:04:33.712] [DEBUG] Using working directory: D:\Repository\Test
[2022-03-19 00:04:34.126] [DEBUG] Using nodePath: C:\Program Files\nodejs\node.exe
[2022-03-19 00:04:34.788] [DEBUG] Using Mocha options: {"ui":"bdd","timeout":3000,"retries":0,"requires":[],"delay":false,"fullTrace":false,"exit":false,"asyncOnly":false,"parallel":false}
[2022-03-19 00:04:34.795] [DEBUG] Looking for test files ["./tests/*.ts"] in d:\Repository\Test
[2022-03-19 00:04:34.800] [DEBUG] Found test files ["D:\\Repository\\Test\\tests\\simple.test.ts"]
[2022-03-19 00:04:34.802] [DEBUG] Using environment variables from config: {}
[2022-03-19 00:04:34.804] [DEBUG] Spawning c:\Users\****\.vscode\extensions\hbenl.vscode-mocha-test-adapter-2.13.3\out\worker\bundle.js with IPC options {}

My node version is 14.18.2

Any suggestion ?
Thanks !

@PEZ
Copy link

PEZ commented Mar 27, 2022

I have the same issue. I've been able to see and run my tests for years, and for months using the current version, but now I can't.

EDIT: It works in VS Code Insiders though...

@Y0me
Copy link
Author

Y0me commented Mar 28, 2022

Upgrading to node version 16.14.2, did the trick for me.
Didn't investigate that much... this link looks interesting.

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