Fix type errors in bolt-selftest.ts

This commit is contained in:
Sam Vervaeck 2022-09-10 17:46:57 +02:00
parent be2ba1023d
commit d12ffa1de5

View file

@ -9,9 +9,7 @@ import path from "path";
import yargs from "yargs";
import { Checker } from "../checker";
import { TextFile } from "../cst";
import { Parser } from "../parser";
import { Punctuator, Scanner } from "../scanner";
import { ConsoleDiagnostics, DiagnosticStore } from "../diagnostics";
import { ConsoleDiagnostics } from "../diagnostics";
import { parseSourceFile } from "..";
const projectDir = path.resolve(__dirname, '..', '..');
@ -40,12 +38,12 @@ yargs
async function* loadTests(): AsyncIterable<Test> {
for (const filename of globSync(path.join(projectDir, 'src', 'test', '**', '*.md'))) {
const text = await fs.promises.readFile(filename, 'utf-8');
const reader = commonmark.Parser();
const reader = new commonmark.Parser();
const root = reader.parse(text);
let child = root.firstChild;
while (child !== null) {
if (child.type === 'code_block') {
yield { code: child.literal };
yield { code: child.literal! };
}
child = child.next;
}