Module

x/cliffy/testing/mod.ts>snapshotTest

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Latest
function snapshotTest
import { snapshotTest } from "https://dotland.deno.dev/x/cliffy@v1.0.0-rc.4/testing/mod.ts";

Run prompt snapshot tests.

import { snapshotTest } from "./snapshot.ts";
import { Input } from "../prompt/input.ts";

await snapshotTest({
  name: "test name",
  meta: import.meta,
  osSuffix: ["windows"],
  steps: {
    "should enter some text": { stdin: ["foo bar", "\n"] },
  },
  async fn() {
    await Input.prompt({
      message: "Whats your name?",
      default: "foo",
    });
  },
});

Parameters

Test options

Returns

Promise<void>