Skip to content

Commit a6b53c0

Browse files
committed
fix tests
1 parent be710f9 commit a6b53c0

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

tests/smoke/inspect/inspect-cleanup.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
*/
77

8+
import { normalizePath } from "../../../src/core/path.ts";
89
import { existsSync } from "../../../src/deno_ral/fs.ts";
910
import { } from "../../../src/project/types.ts";
1011
import {
@@ -25,7 +26,7 @@ import { assert } from "testing/asserts";
2526
verify: async (outputs: ExecuteOutput[]) => {
2627
assert(existsSync(output));
2728
const json = JSON.parse(Deno.readTextFileSync(output));
28-
assert(json.fileInformation["docs/inspect/cleanup-issue-12336/cleanup-bug.qmd"].metadata.engine === "jupyter");
29+
assert(json.fileInformation[normalizePath("docs/inspect/cleanup-issue-12336/cleanup-bug.qmd")].metadata.engine === "jupyter");
2930
assert(!existsSync("docs/inspect/cleanup-issue-12336/cleanup-bug.quarto_ipynb"));
3031
}
3132
}

tests/smoke/inspect/inspect-include.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
testQuartoCmd,
1212
} from "../../test.ts";
1313
import { assert } from "testing/asserts";
14+
import { normalizePath } from "../../../src/core/path.ts";
1415

1516
(() => {
1617
const input = "docs/inspect/foo.qmd";
@@ -22,20 +23,21 @@ import { assert } from "testing/asserts";
2223
{
2324
name: "inspect-include",
2425
verify: async (outputs: ExecuteOutput[]) => {
25-
assert(existsSync("docs/inspect/foo.json"));
26-
const json = JSON.parse(Deno.readTextFileSync("docs/inspect/foo.json"));
27-
assertObjectMatch(json.fileInformation["docs/inspect/foo.qmd"].includeMap[0],
26+
assert(existsSync(output));
27+
const normalizedPath = normalizePath(input);
28+
const json = JSON.parse(Deno.readTextFileSync(output));
29+
assertObjectMatch(json.fileInformation[normalizedPath].includeMap[0],
2830
{
29-
source: input,
31+
source: normalizedPath,
3032
target: "_bar.qmd"
3133
});
3234
}
3335
}
3436
],
3537
{
3638
teardown: async () => {
37-
if (existsSync("docs/inspect/foo.json")) {
38-
Deno.removeSync("docs/inspect/foo.json");
39+
if (existsSync(output)) {
40+
Deno.removeSync(output);
3941
}
4042
}
4143
},

tests/smoke/inspect/inspect-recursive-include.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
testQuartoCmd,
1313
} from "../../test.ts";
1414
import { assert, assertEquals } from "testing/asserts";
15+
import { normalizePath } from "../../../src/core/path.ts";
1516

1617
(() => {
1718
const input = "docs/websites/issue-9253/index.qmd";
@@ -25,7 +26,7 @@ import { assert, assertEquals } from "testing/asserts";
2526
verify: async (outputs: ExecuteOutput[]) => {
2627
assert(existsSync(output));
2728
const json = JSON.parse(Deno.readTextFileSync(output));
28-
const info = json.fileInformation["docs/websites/issue-9253/index.qmd"];
29+
const info = json.fileInformation[normalizePath("docs/websites/issue-9253/index.qmd")];
2930
const includeMap: FileInclusion[] = info.includeMap;
3031
assertObjectMatch(info.includeMap[0], { target: "_include.qmd" });
3132
assertObjectMatch(info.includeMap[1], { source: "_include.qmd", target: "_include2.qmd" });

0 commit comments

Comments
 (0)