Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fresh_testing_library/components.ts>Options

Utilities for testing fresh apps
Latest
interface Options
Re-export
import { type Options } from "https://deno.land/x/fresh_testing_library@0.13.0/components.ts";

Properties

optional
applyAccept: boolean

When using userEvent.upload, automatically discard files that don't match an accept property if it exists.

optional
autoModify: boolean

We intend to automatically apply modifier keys for printable characters in the future. I.e. A implying {Shift>}a{/Shift} if caps lock is not active.

This options allows you to opt out of this change in foresight. The feature therefore will not constitute a breaking change.

optional
delay: number | null

Between some subsequent inputs like typing a series of characters the code execution is delayed per setTimeout for (at least) delay seconds. This moves the next changes at least to next macro task and allows other (asynchronous) code to run between events.

null prevents setTimeout from being called.

optional
document: Document

The document.

This defaults to the owner document of an element if an API is called directly with an element and without setup. Otherwise it falls back to the global document.

optional
keyboardMap: keyboardKey[]

An array of keyboard keys the keyboard device consists of.

This allows to plug in different layouts / localizations.

Defaults to a "standard" US-104-QWERTY keyboard.

optional
pointerMap: pointerKey[]

An array of available pointer keys.

This allows to plug in different pointer devices.

optional
pointerEventsCheck: PointerEventsCheckLevel | number

The pointer API includes a check if an element has or inherits pointer-events: none. This check is known to be expensive and very expensive when checking deeply nested nodes. This option determines how often the pointer related APIs perform the check.

This is a binary flag option. You can combine multiple Levels.

optional
skipAutoClose: boolean

userEvent.type automatically releases any keys still pressed at the end of the call. This option allows to opt out of this feature.

optional
skipClick: boolean

userEvent.type implies a click at the end of the element content/value. This option allows to opt out of this feature.

optional
skipHover: boolean

userEvent.click implies moving the cursor to the target element first. This options allows to opt out of this feature.

optional
writeToClipboard: boolean

Write selected data to Clipboard API when a cut or copy is triggered.

The Clipboard API is usually not available to test code. Our setup replaces the navigator.clipboard property with a stub.

Defaults to false when calling the APIs directly. Defaults to true when calling the APIs per setup.

optional
advanceTimers: ((delay: number) => Promise<void>) | ((delay: number) => void)

A function to be called internally to advance your fake timers (if applicable)