The `test-keyboard` package provides a programmatic way to compose and dispatch synthetic keyboard events to the DOM, mimicking user typing actions. It is primarily designed for DOM test environments, enabling robust testing of applications that heavily rely on keyboard interactions. This library is part of the broader Remirror ecosystem, though it maintains its own versioning, with the current stable version being 2.0.7. It offers features like batching events for controlled dispatch and simulating OS-specific behaviors (e.g., Mac key modifiers). While the main Remirror packages are in their 3.x series, `test-keyboard` is at 2.x, implying a potentially independent release cadence or a planned future major update to align with Remirror v3.
npm install test-keyboardVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating a `Keyboard` instance, composing a sequence of key presses with modifiers, and dispatching them to a target DOM element.
Check for a `test-keyboard@3.x` release if using `remirror@3.x` and verify compatibility. For now, ensure your testing environment aligns with the `test-keyboard`'s documented dependencies.
Always call `.end()` after composing your sequence of actions if `batch: true` is enabled to ensure all events are dispatched.
Always provide a valid `Element` to the `target` property when calling `Keyboard.create({ target: yourElement })`.Ensure the `target` property of `KeyboardConstructorParameter` is a valid DOM `Element`.
Add `.end()` at the end of your keyboard action chain, e.g., `Keyboard.create({...}).start().press('a').end();`Run `npm install test-keyboard` or `yarn add test-keyboard`. Ensure your build configuration correctly handles module resolution, especially between CommonJS and ES Modules.
No dependency data recorded yet.