@vitest/browser 2.0.3 → 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 +12 -4
- package/dist/client/.vite/manifest.json +1 -1
- package/dist/client/__vitest__/assets/index--EAEh9Ei.js +52 -0
- package/dist/client/__vitest__/assets/index-C0SwoDYm.css +1 -0
- package/dist/client/__vitest__/index.html +2 -2
- package/dist/client/__vitest_browser__/{tester-DoK-7PCe.js → tester-l8kjusoM.js} +12 -5
- package/dist/client/tester/tester.html +1 -1
- package/dist/context.js +92 -60
- package/dist/index.d.ts +4 -2
- package/dist/index.js +115 -53
- package/package.json +15 -15
- package/dist/client/__vitest__/assets/index-Ct7j6Tgf.css +0 -1
- package/dist/client/__vitest__/assets/index-gyhe06Cm.js +0 -52
package/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
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-
|
|
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-
|
|
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:
|
|
256
|
+
config: SerializedConfig
|
|
249
257
|
/**
|
|
250
258
|
* Change the size of iframe's viewport.
|
|
251
259
|
*/
|