Skip to content

Commit 07109f3

Browse files
committed
Fix docs tests for TypeScript 6 compatibility
1 parent 1d6395a commit 07109f3

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

docs/tests/index.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import * as approvals from "approvals";
66
import {configure} from "approvals/lib/config";
77
import {JestReporter} from "approvals/lib/Providers/Jest/JestReporter";
88

9-
const markdownFiles = [];
9+
const markdownFiles: string[] = [];
1010
const includedFolders = ["docs"]
1111

1212
// collecting all markdown files to be tested
1313
includedFolders.forEach(dir => {
1414
fs.readdirSync(path.join(__dirname, "..", dir), { recursive: true }).forEach(file => {
15-
if (file.toLowerCase().endsWith(".md")) {
16-
markdownFiles.push(path.join(dir, file))
15+
const name = String(file);
16+
if (name.toLowerCase().endsWith(".md")) {
17+
markdownFiles.push(path.join(dir, name))
1718
}
1819
});
1920
});

docs/tests/jbang.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module '@jbangdev/jbang' {
2+
export function exec(script: string, ...args: string[]): { exitCode: number; stdout: string; stderr: string };
3+
}

0 commit comments

Comments
 (0)