Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"@types/glob": "^9.0.0",
"@types/mocha": "^10.0.10",
"@types/node": "^26.1.0",
"@types/vscode": "^1.125.0",
"@types/vscode": "^1.53.0",
"@typescript-eslint/eslint-plugin": "^8.62.1",
"@typescript-eslint/parser": "^8.62.0",
"@vscode/test-electron": "^3.0.0",
Expand Down
12 changes: 4 additions & 8 deletions src/test/suite/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'path';
import * as Mocha from 'mocha';
import * as glob from 'glob';
import Mocha from 'mocha';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lemmy worth adding?

@lemmy lemmy Jul 7, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This finding is wrong/upside down:

-> % git diff
diff --git a/src/test/suite/index.ts b/src/test/suite/index.ts
index 0ac2b26..534144d 100644
--- a/src/test/suite/index.ts
+++ b/src/test/suite/index.ts
@@ -1,5 +1,5 @@
 import * as path from 'path';
-import Mocha from 'mocha';
+import * as Mocha from 'mocha';
 import { glob } from 'glob';
 
 export function run(): Promise<void> {

-> % npm run compile

> cbmc-proof-debugger@1.0.1 compile
> tsc -p ./

src/test/suite/index.ts:7:20 - error TS2351: This expression is not constructable.
  Type 'typeof Mocha' has no construct signatures.

7  const mocha = new Mocha({
                     ~~~~~

  src/test/suite/index.ts:2:1
    2 import * as Mocha from 'mocha';
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.

src/test/suite/index.ts:21:15 - error TS7006: Parameter 'failures' implicitly has an 'any' type.

21     mocha.run(failures => {
                 ~~~~~~~~


Found 2 errors in the same file, starting at: src/test/suite/index.ts:7

import { glob } from 'glob';

export function run(): Promise<void> {
// Create the mocha test
Expand All @@ -12,11 +12,7 @@ export function run(): Promise<void> {
const testsRoot = path.resolve(__dirname, '..');

return new Promise((c, e) => {
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}

glob('**/**.test.js', { cwd: testsRoot }).then(files => {
// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));

Expand All @@ -33,6 +29,6 @@ export function run(): Promise<void> {
console.error(err);
e(err);
}
});
}, e);
});
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"sourceMap": true,
"rootDir": "src",
"newLine": "lf",
"skipLibCheck": true,
"strict": true /* enable all strict type-checking options */
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
Expand Down
Loading