Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zph committed Feb 3, 2025
1 parent f724782 commit 740955e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 0 additions & 8 deletions tests/__snapshots__/cli_test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
export const snapshot = {};

snapshot[`check 1`] = `
{
exitCode: 0,
stderrEndsWith: true,
stdoutEndsWith: true,
}
`;

snapshot[`convert 1`] = `
{
exitCode: 0,
Expand Down
6 changes: 4 additions & 2 deletions tests/cli_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// review
// run

import { assertEquals, assertArrayIncludes } from "jsr:@std/assert";
import { assertEquals, assertArrayIncludes, assertMatch } from "jsr:@std/assert";
import { assertSnapshot } from "jsr:@std/testing/snapshot";
import { $ } from "jsr:@david/dax"

Expand All @@ -28,7 +28,9 @@ const setup = async () => {
Deno.test("check", async (t) => {
const {runbook } = await setup();
const cmd = await runbook(["check", "runbooks/binder/_template-deno.ipynb"]);
assertSnapshot(t, { exitCode: cmd.code, stdoutEndsWith: cmd.stdout.trim().endsWith("runbooks/binder/_template-deno.ipynb"), stderrEndsWith: cmd.stderr.trim().endsWith(".ts") });
assertMatch(cmd.stdout.trim(), /Checked .*\/runbooks\/binder\/_template-deno\.ipynb/);
assertMatch(cmd.stderr.trim(), /.*Check.*runbooks\/binder\/_template-deno-.*\.ts/);
assertEquals(cmd.code, 0);
});

Deno.test("convert", async (t) => {
Expand Down

0 comments on commit 740955e

Please sign in to comment.