import { type SnapshotTestOptions } from "https://deno.land/x/cliffy@v1.0.0-rc.1/testing/snapshot.ts";
Snapshot test options.
Properties
Import meta. Required to determine the import url of the test file.
Object of test steps. Key is the test name and the value is an array of input sequences/characters.
Arguments passed to the deno test
command when executing the snapshot
tests. --allow-env=SNAPSHOT_TEST_NAME
is passed by default.
Snapshot output directory. Snapshot files will be written to this directory. This can be relative to the test directory or an absolute path.
If both dir
and path
are specified, the dir
option will be ignored and
the path
option will be handled as normal.
Snapshot output path. The snapshot will be written to this file. This can be a path relative to the test directory or an absolute path.
If both dir
and path
are specified, the dir
option will be ignored and
the path
option will be handled as normal.
Operating system snapshot suffix. This is useful when your test produces different output on different operating systems.
Timeout in milliseconds to wait until the input stream data is buffered
before writing the next data to the stream. This ensures that each user
input is rendered as separate line in the snapshot file. If your test gets
flaky, try to increase the timeout. The default timeout is 600
.
If truthy the current test step will be ignored.
It is a quick way to skip over a step, but also can be used for conditional logic, like determining if an environment feature is present.
If at least one test has only
set to true
, only run tests that have
only
set to true
and fail the test suite.