@storybook/test 0.0.0-pr-26827-sha-2e5a457b → 0.0.0-pr-26923-sha-300a6ba8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,17 +1,18 @@
1
1
  import { AsymmetricMatchersContaining, MatchersObject, MatcherState, JestAssertion, ExpectStatic } from '@vitest/expect';
2
- import { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers';
3
- import { spyOn as spyOn$1, fn as fn$1, MaybeMocked, MaybeMockedDeep, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
2
+ import * as matchers from '@testing-library/jest-dom/matchers';
3
+ import { MaybeMocked, MaybeMockedDeep, MaybePartiallyMocked, MaybePartiallyMockedDeep } from '@vitest/spy';
4
4
  export * from '@vitest/spy';
5
- export { isMockFunction, mocks } from '@vitest/spy';
5
+ export { fn, isMockFunction, spies as mocks, spyOn } from '@vitest/spy';
6
+ import * as _testing_library_user_event_dist_types_setup_directApi from '@testing-library/user-event/dist/types/setup/directApi';
7
+ import * as _testing_library_user_event_dist_types_setup_setup from '@testing-library/user-event/dist/types/setup/setup';
6
8
  import * as domTestingLibrary from '@testing-library/dom';
7
- import _userEvent from '@testing-library/user-event';
8
9
 
9
10
  type Promisify<Fn> = Fn extends (...args: infer A) => infer R ? (...args: A) => R extends Promise<any> ? R : Promise<R> : Fn;
10
11
  type PromisifyObject<O> = {
11
12
  [K in keyof O]: Promisify<O[K]>;
12
13
  };
13
14
 
14
- type Matchers<T> = PromisifyObject<JestAssertion<T>> & TestingLibraryMatchers<ReturnType<ExpectStatic['stringContaining']>, Promise<void>>;
15
+ type Matchers<T> = PromisifyObject<JestAssertion<T>> & matchers.TestingLibraryMatchers<ReturnType<ExpectStatic['stringContaining']>, Promise<void>>;
15
16
  interface Assertion<T> extends Matchers<T> {
16
17
  toHaveBeenCalledOnce(): Promise<void>;
17
18
  toSatisfy<E>(matcher: (value: E) => boolean, message?: string): Promise<void>;
@@ -33,10 +34,6 @@ interface Expect extends AsymmetricMatchersContaining {
33
34
  not: AsymmetricMatchersContaining;
34
35
  }
35
36
 
36
- type Listener = (mock: MockInstance, args: unknown[]) => void;
37
- declare function onMockCall(callback: Listener): () => void;
38
- declare const spyOn: typeof spyOn$1;
39
- declare const fn: typeof fn$1;
40
37
  /**
41
38
  * Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function. This will only empty `.mock` state, it will not reset implementation.
42
39
  *
@@ -155,13 +152,26 @@ declare const waitFor: typeof domTestingLibrary.waitFor;
155
152
  declare const waitForElementToBeRemoved: typeof domTestingLibrary.waitForElementToBeRemoved;
156
153
  declare const within: typeof domTestingLibrary.getQueriesForElement;
157
154
  declare const prettyFormat: typeof domTestingLibrary.prettyFormat;
158
- type _UserEvent = typeof _userEvent;
159
- interface UserEvent extends _UserEvent {
160
- }
161
- declare const userEvent: UserEvent;
155
+ declare const userEvent: {
156
+ readonly setup: typeof _testing_library_user_event_dist_types_setup_setup.setupMain;
157
+ readonly clear: typeof _testing_library_user_event_dist_types_setup_directApi.clear;
158
+ readonly click: typeof _testing_library_user_event_dist_types_setup_directApi.click;
159
+ readonly copy: typeof _testing_library_user_event_dist_types_setup_directApi.copy;
160
+ readonly cut: typeof _testing_library_user_event_dist_types_setup_directApi.cut;
161
+ readonly dblClick: typeof _testing_library_user_event_dist_types_setup_directApi.dblClick;
162
+ readonly deselectOptions: typeof _testing_library_user_event_dist_types_setup_directApi.deselectOptions;
163
+ readonly hover: typeof _testing_library_user_event_dist_types_setup_directApi.hover;
164
+ readonly keyboard: typeof _testing_library_user_event_dist_types_setup_directApi.keyboard;
165
+ readonly pointer: typeof _testing_library_user_event_dist_types_setup_directApi.pointer;
166
+ readonly paste: typeof _testing_library_user_event_dist_types_setup_directApi.paste;
167
+ readonly selectOptions: typeof _testing_library_user_event_dist_types_setup_directApi.selectOptions;
168
+ readonly tripleClick: typeof _testing_library_user_event_dist_types_setup_directApi.tripleClick;
169
+ readonly type: typeof _testing_library_user_event_dist_types_setup_directApi.type;
170
+ readonly unhover: typeof _testing_library_user_event_dist_types_setup_directApi.unhover;
171
+ readonly upload: typeof _testing_library_user_event_dist_types_setup_directApi.upload;
172
+ readonly tab: typeof _testing_library_user_event_dist_types_setup_directApi.tab;
173
+ };
162
174
 
163
175
  declare const expect: Expect;
164
176
 
165
- declare const traverseArgs: (value: unknown, depth?: number, key?: string) => unknown;
166
-
167
- export { UserEvent, buildQueries, clearAllMocks, configure, createEvent, expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, fn, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, logDOM, logRoles, mocked, onMockCall, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, resetAllMocks, restoreAllMocks, screen, spyOn, traverseArgs, userEvent, waitFor, waitForElementToBeRemoved, within };
177
+ export { buildQueries, clearAllMocks, configure, createEvent, expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, logDOM, logRoles, mocked, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, resetAllMocks, restoreAllMocks, screen, userEvent, waitFor, waitForElementToBeRemoved, within };