Skip to content

Commit 5383c96

Browse files
committed
Add fileNotExists verification and smoke-all test for keep-ipynb cleanup
- Add `fileNotExists` to verify.ts, mirroring `fileExists` but calling `verifyNoPath` instead of `verifyPath` - Wire `fileNotExists` into smoke-all.test.ts verifyMap handling block alongside the existing `fileExists` block - Add smoke-all test 14359.qmd that verifies the .quarto_ipynb intermediate file is cleaned up after render when keep-ipynb defaults to false
1 parent 6910d64 commit 5383c96

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
format: html
3+
_quarto:
4+
tests:
5+
html:
6+
fileNotExists:
7+
outputPath: 14359.quarto_ipynb
8+
---
9+
10+
```{python}
11+
1 + 1
12+
```

tests/smoke/smoke-all.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
ensureTypstFileRegexMatches,
3535
ensureSnapshotMatches,
3636
fileExists,
37+
fileNotExists,
3738
noErrors,
3839
noErrorsOrWarnings,
3940
ensurePptxXpath,
@@ -269,6 +270,22 @@ function resolveTestSpecs(
269270
);
270271
}
271272
}
273+
} else if (key === "fileNotExists") {
274+
for (
275+
const [path, file] of Object.entries(
276+
value as Record<string, string>,
277+
)
278+
) {
279+
if (path === "outputPath") {
280+
verifyFns.push(
281+
fileNotExists(join(dirname(outputFile.outputPath), file)),
282+
);
283+
} else if (path === "supportPath") {
284+
verifyFns.push(
285+
fileNotExists(join(outputFile.supportPath, file)),
286+
);
287+
}
288+
}
272289
} else if (["ensurePptxLayout", "ensurePptxXpath"].includes(key)) {
273290
if (Array.isArray(value) && Array.isArray(value[0])) {
274291
// several slides to check

tests/verify.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,16 @@ export const fileExists = (file: string): Verify => {
235235
};
236236
};
237237

238+
export const fileNotExists = (file: string): Verify => {
239+
return {
240+
name: `File ${file} does not exist`,
241+
verify: (_output: ExecuteOutput[]) => {
242+
verifyNoPath(file);
243+
return Promise.resolve();
244+
},
245+
};
246+
};
247+
238248
export const pathDoNotExists = (path: string): Verify => {
239249
return {
240250
name: `path ${path} do not exists`,

0 commit comments

Comments
 (0)