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

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,18 +1,17 @@
1
1
  import { AsymmetricMatchersContaining, MatchersObject, MatcherState, JestAssertion, ExpectStatic } from '@vitest/expect';
2
- import * as matchers from '@testing-library/jest-dom/matchers';
3
- import { MaybeMocked, MaybeMockedDeep, MaybePartiallyMocked, MaybePartiallyMockedDeep } from '@vitest/spy';
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';
4
4
  export * 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';
5
+ export { isMockFunction, mocks } from '@vitest/spy';
8
6
  import * as domTestingLibrary from '@testing-library/dom';
7
+ import _userEvent from '@testing-library/user-event';
9
8
 
10
9
  type Promisify<Fn> = Fn extends (...args: infer A) => infer R ? (...args: A) => R extends Promise<any> ? R : Promise<R> : Fn;
11
10
  type PromisifyObject<O> = {
12
11
  [K in keyof O]: Promisify<O[K]>;
13
12
  };
14
13
 
15
- type Matchers<T> = PromisifyObject<JestAssertion<T>> & matchers.TestingLibraryMatchers<ReturnType<ExpectStatic['stringContaining']>, Promise<void>>;
14
+ type Matchers<T> = PromisifyObject<JestAssertion<T>> & TestingLibraryMatchers<ReturnType<ExpectStatic['stringContaining']>, Promise<void>>;
16
15
  interface Assertion<T> extends Matchers<T> {
17
16
  toHaveBeenCalledOnce(): Promise<void>;
18
17
  toSatisfy<E>(matcher: (value: E) => boolean, message?: string): Promise<void>;
@@ -34,6 +33,10 @@ interface Expect extends AsymmetricMatchersContaining {
34
33
  not: AsymmetricMatchersContaining;
35
34
  }
36
35
 
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;
37
40
  /**
38
41
  * Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function. This will only empty `.mock` state, it will not reset implementation.
39
42
  *
@@ -152,26 +155,13 @@ declare const waitFor: typeof domTestingLibrary.waitFor;
152
155
  declare const waitForElementToBeRemoved: typeof domTestingLibrary.waitForElementToBeRemoved;
153
156
  declare const within: typeof domTestingLibrary.getQueriesForElement;
154
157
  declare const prettyFormat: typeof domTestingLibrary.prettyFormat;
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
- };
158
+ type _UserEvent = typeof _userEvent;
159
+ interface UserEvent extends _UserEvent {
160
+ }
161
+ declare const userEvent: UserEvent;
174
162
 
175
163
  declare const expect: Expect;
176
164
 
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 };
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 };