CoderLine / mocha-vscode

A Mocha test runner extension for VS Code
https://marketplace.visualstudio.com/items?itemName=coderline.mocha-vscode
MIT License
8 stars 2 forks source link

[Bug]: Error in before hook mark tests as skipped. Should be failed #159

Closed muhammadyusuf-kurbonov closed 1 month ago

muhammadyusuf-kurbonov commented 1 month ago

Checklist

Actual behavior

If you will have error during before hook, tests are skipped

Expected behavior

Mark following tests (or test suite itself) failed

Minimal, Reproducible Example

https://github.com/muhammadyusuf-kurbonov/mocha-forVSCode-bug-example

Output

2024-10-08 22:51:15.699 [debug] Creating new test run {"include":[{"id":"Example test","uri":{"$mid":1,"fsPath":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/test/example.test.ts","external":"file:///home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/test/example.test.ts","path":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/test/example.test.ts","scheme":"file"},"children":[{"id":"test example","uri":{"$mid":1,"fsPath":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/test/example.test.ts","external":"file:///home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/test/example.test.ts","path":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/test/example.test.ts","scheme":"file"},"children":[],"range":[{"line":5,"character":4},{"line":7,"character":5}],"label":"test example","canResolveChildren":false,"busy":false,"tags":[]},{"id":"Skipped test","uri":{"$mid":1,"fsPath":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/test/example.test.ts","external":"file:///home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/test/example.test.ts","path":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/test/example.test.ts","scheme":"file"},"children":[],"range":[{"line":8,"character":7},{"line":8,"character":9007199254740991}],"label":"Skipped test","canResolveChildren":false,"busy":false,"tags":[]}],"range":[{"line":0,"character":0},{"line":10,"character":1}],"label":"Example test","canResolveChildren":false,"busy":false,"tags":[]}],"exclude":[],"profile":{"controllerId":"file:///home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/.mocharc.yml","profileId":-572981039,"g":"Mocha Config","kind":1,"h":false},"continuous":false,"preserveFocus":true} 2024-10-08 22:51:15.699 [debug] resolving 'mocha' via /home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example 2024-10-08 22:51:15.701 [debug] 'mocha' resolved to '/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/node_modules/mocha/index.js' 2024-10-08 22:51:15.702 [debug] resolving 'mocha' via /home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example 2024-10-08 22:51:15.703 [debug] 'mocha' resolved to '/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/node_modules/mocha/index.js' 2024-10-08 22:51:15.716 [info] Start test execution with args ["/home/muhammadyusuf-kurbonov/.nvm/versions/node/v22.4.0/bin/node","/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/node_modules/mocha/bin/mocha.js","--config","/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/.mocharc.yml","--reporter","/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/node_modules/.mocha-vscode/fullJsonStreamReporter.js","--ignore","*/.*","--file","test/example.test.ts","--grep","/^(Example test )/"] 2024-10-08 22:51:15.716 [info] Start test execution with env {"NODE_ENV":"test"} 2024-10-08 22:51:15.779 [debug] Syncing file {"$mid":1,"fsPath":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/node_modules/.mocha-vscode/fullJsonStreamReporter.js","path":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/node_modules/.mocha-vscode/fullJsonStreamReporter.js","scheme":"file"} 2024-10-08 22:51:15.779 [debug] Syncing file {"$mid":1,"fsPath":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/node_modules/.mocha-vscode/fullJsonStreamReporterTypes.js","path":"/home/muhammadyusuf-kurbonov/Projects/mocha-forVSCode-bug-example/node_modules/.mocha-vscode/fullJsonStreamReporterTypes.js","scheme":"file"} 2024-10-08 22:51:16.227 [error] Error: Test process exited with code 1 at ChildProcess. (/home/muhammadyusuf-kurbonov/Projects/mocha-vscode/out/runner.js:298:28) at ChildProcess.emit (node:events:519:28) at ChildProcess._handle.onexit (node:internal/child_process:294:12) at Process.callbackTrampoline (node:internal/async_hooks:130:17)

Plugin Version Details

Name: Mocha for VS Code Id: coderline.mocha-vscode Description: Run and debug Mocha tests right within VS Code. Version: 1.2.0 Publisher: CoderLine VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=coderline.mocha-vscode

VS Code Version Details

Version: 1.94.0 Commit: d78a74bcdfad14d5d3b1b782f87255d802b57511 Date: 2024-10-02T13:08:12.626Z Electron: 30.5.1 ElectronBuildId: 10262041 Chromium: 124.0.6367.243 Node.js: 20.16.0 V8: 12.4.254.20-electron.0 OS: Linux x64 6.10.12-200.fc40.x86_64

Further details

No response