Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/api/user-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If User Event supports a given interaction, prefer it over the Fire Event counte
userEvent.setup(options?: {
delay?: number;
advanceTimers?: (delay: number) => Promise<void> | void;
})
}): UserEventInstance
```

Example
Expand All @@ -23,7 +23,7 @@ Example
const user = userEvent.setup();
```

Creates a User Event object instance, which can be used to trigger events.
Creates a User Event object instance, which can be used to trigger events. Its type, `UserEventInstance`, is exported from the package, so a helper that returns or receives the instance can name it.

### Options

Expand Down
2 changes: 1 addition & 1 deletion src/pure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ export { userEvent } from './user-event';
export type { RenderOptions, RenderResult, DebugFunction } from './render';
export type { RenderHookOptions, RenderHookResult } from './render-hook';
export type { Config } from './config';
export type { UserEventConfig } from './user-event';
export type { UserEventConfig, UserEventInstance } from './user-event';
2 changes: 1 addition & 1 deletion src/user-event/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { ScrollToOptions } from './scroll';
import { setup } from './setup';
import type { TypeOptions } from './type';

export { UserEventConfig } from './setup';
export type { UserEventConfig, UserEventInstance } from './setup';

export const userEvent = {
setup,
Expand Down
2 changes: 1 addition & 1 deletion src/user-event/setup/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const defaultOptions: Required<UserEventSetupOptions> = {
* @param options
* @returns UserEvent instance
*/
export function setup(options?: UserEventSetupOptions) {
export function setup(options?: UserEventSetupOptions): UserEventInstance {
const config = createConfig(options, setup);
const instance = createInstance(config);
return instance;
Expand Down
4 changes: 2 additions & 2 deletions website/docs/14.x/docs/api/events/user-event.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If User Event supports a given interaction, prefer it over the Fire Event counte
userEvent.setup(options?: {
delay?: number;
advanceTimers?: (delay: number) => Promise<void> | void;
})
}): UserEventInstance
```

Example
Expand All @@ -23,7 +23,7 @@ Example
const user = userEvent.setup();
```

Creates a User Event object instance, which can be used to trigger events.
Creates a User Event object instance, which can be used to trigger events. Its type, `UserEventInstance`, is exported from the package, so a helper that returns or receives the instance can name it.

### Options {#setup-options}

Expand Down