Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/cliffy/testing/snapshot.ts>snapshotTest

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
function snapshotTest
import { snapshotTest } from "https://deno.land/x/cliffy@v1.0.0-rc.1/testing/snapshot.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>