Skip to content

Commit e8730de

Browse files
committed
chore - deno 2
1 parent d028dd5 commit e8730de

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

tests/smoke/smoke-all.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ async function guessFormat(fileName: string): Promise<string[]> {
6262
try {
6363
yaml = parse(src);
6464
} catch (e) {
65+
if (!(e instanceof Error)) throw e;
6566
if (e.message.includes("unknown tag")) {
6667
// assume it's not necessary to guess the format
6768
continue;

tests/test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ export function test(test: TestDescriptor) {
241241
}
242242
}
243243
} catch (ex) {
244+
if (!(ex instanceof Error)) throw ex;
244245
const border = "-".repeat(80);
245246
const coloredName = userSession
246247
? colors.brightGreen(colors.italic(testName))
@@ -287,7 +288,7 @@ export function test(test: TestDescriptor) {
287288
coloredVerify,
288289
"",
289290
ex.message,
290-
ex.stack,
291+
ex.stack ?? "",
291292
"",
292293
];
293294

tests/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function findProjectOutputDir(projectdir: string | undefined) {
5252
// deno-lint-ignore no-explicit-any
5353
type = ((yaml as any).project as any).type;
5454
} catch (error) {
55-
throw new Error("Failed to read quarto project YAML", error);
55+
throw new Error("Failed to read quarto project YAML" + String(error));
5656
}
5757
if (type === "book") {
5858
return "_book";

tests/verify.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { outputForInput } from "./utils.ts";
1919
import { unzip } from "../src/core/zip.ts";
2020
import { dirAndStem, safeRemoveSync, which } from "../src/core/path.ts";
2121
import { isWindows } from "../src/deno_ral/platform.ts";
22-
import { execProcess } from "../src/core/process.ts";
22+
import { execProcess, ExecProcessOptions } from "../src/core/process.ts";
2323
import { canonicalizeSnapshot, checkSnapshot } from "./verify-snapshot.ts";
2424

2525
export const withDocxContent = async <T>(
@@ -978,9 +978,10 @@ export const ensureXmlValidatesWithXsd = (
978978
name: "Validating XML",
979979
verify: async (_output: ExecuteOutput[]) => {
980980
if (!isWindows) {
981-
const cmd = ["xmllint", "--noout", "--valid", file, "--path", xsdPath];
982-
const runOptions: Deno.RunOptions = {
983-
cmd,
981+
const args = ["--noout", "--valid", file, "--path", xsdPath];
982+
const runOptions: ExecProcessOptions = {
983+
cmd: "xmllint",
984+
args,
984985
stderr: "piped",
985986
stdout: "piped",
986987
};
@@ -1006,7 +1007,8 @@ export const ensureMECAValidates = (
10061007
const hasMeca = await which("meca");
10071008
if (hasMeca) {
10081009
const result = await execProcess({
1009-
cmd: ["meca", "validate", mecaFile],
1010+
cmd: "meca",
1011+
args: ["validate", mecaFile],
10101012
stderr: "piped",
10111013
stdout: "piped",
10121014
});

0 commit comments

Comments
 (0)