@vitest/browser 2.0.4 → 2.0.5

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/context.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ResolvedConfig } from 'vitest'
1
+ import type { SerializedConfig } from 'vitest'
2
2
 
3
3
  export type BufferEncoding =
4
4
  | 'ascii'
@@ -49,6 +49,14 @@ export interface BrowserCommands {
49
49
  }
50
50
 
51
51
  export interface UserEvent {
52
+ /**
53
+ * Creates a new user event instance. This is useful if you need to keep the
54
+ * state of keyboard to press and release buttons correctly.
55
+ *
56
+ * **Note:** Unlike `@testing-library/user-event`, the default `userEvent` instance
57
+ * from `@vitest/browser/context` is created once, not every time its methods are called!
58
+ * @see {@link https://vitest.dev/guide/browser/interactivity-api.html#userevent-setup}
59
+ */
52
60
  setup: () => UserEvent
53
61
  /**
54
62
  * Click on an element. Uses provider's API under the hood and supports all its options.
@@ -103,7 +111,7 @@ export interface UserEvent {
103
111
  * await userEvent.keyboard('foo') // translates to: f, o, o
104
112
  * await userEvent.keyboard('{{a[[') // translates to: {, a, [
105
113
  * await userEvent.keyboard('{Shift}{f}{o}{o}') // translates to: Shift, f, o, o
106
- * @see {@link https://playwright.dev/docs/api/class-locator#locator-press} Playwright API
114
+ * @see {@link https://playwright.dev/docs/api/class-keyboard} Playwright API
107
115
  * @see {@link https://webdriver.io/docs/api/browser/keys} WebdriverIO API
108
116
  * @see {@link https://testing-library.com/docs/user-event/keyboard} testing-library API
109
117
  */
@@ -129,7 +137,7 @@ export interface UserEvent {
129
137
  clear: (element: Element) => Promise<void>
130
138
  /**
131
139
  * Sends a `Tab` key event. Uses provider's API under the hood.
132
- * @see {@link https://playwright.dev/docs/api/class-locator#locator-press} Playwright API
140
+ * @see {@link https://playwright.dev/docs/api/class-keyboard} Playwright API
133
141
  * @see {@link https://webdriver.io/docs/api/element/keys} WebdriverIO API
134
142
  * @see {@link https://testing-library.com/docs/user-event/convenience/#tab} testing-library API
135
143
  */
@@ -245,7 +253,7 @@ export interface BrowserPage {
245
253
  /**
246
254
  * Serialized test config.
247
255
  */
248
- config: ResolvedConfig
256
+ config: SerializedConfig
249
257
  /**
250
258
  * Change the size of iframe's viewport.
251
259
  */
@@ -13,7 +13,7 @@
13
13
  ]
14
14
  },
15
15
  "tester/tester.html": {
16
- "file": "__vitest_browser__/tester-BSSDPE9E.js",
16
+ "file": "__vitest_browser__/tester-l8kjusoM.js",
17
17
  "name": "tester",
18
18
  "src": "tester/tester.html",
19
19
  "isEntry": true,