vitest-browser-vue 1.1.0 → 2.0.0

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Render Vue components in Vitest Browser Mode. This library follows [`testing-library` principles](https://testing-library.com/docs/guiding-principles/) and exposes only [locators](https://vitest.dev/guide/browser/locators) and utilities that encourage you to write tests that closely resemble how your Vue components are used.
4
4
 
5
- Requires `vitest` and `@vitest/browser` 2.1.0 or higher.
5
+ Requires `vitest` 4.0.0 or higher.
6
6
 
7
7
  ```ts
8
8
  import { render } from 'vitest-browser-vue'
@@ -34,15 +34,14 @@ export default defineConfig({
34
34
  // import `vitest-browser-vue` manually so TypeScript can pick it up
35
35
  setupFiles: ['vitest-browser-vue'],
36
36
  browser: {
37
- name: 'chromium',
38
- enabled: true,
37
+ // ... your config
39
38
  },
40
39
  },
41
40
  })
42
41
  ```
43
42
 
44
43
  ```ts
45
- import { page } from '@vitest/browser/context'
44
+ import { page } from 'vitest/browser'
46
45
 
47
46
  test('counter button increments the count', async () => {
48
47
  const screen = page.render(Component, {
@@ -1,8 +1,8 @@
1
1
  // src/pure.ts
2
- import { page } from "@vitest/browser/context";
2
+ import { page, utils } from "vitest/browser";
3
3
  import { mount } from "@vue/test-utils";
4
- import { debug, getElementLocatorSelectors } from "@vitest/browser/utils";
5
4
  import { config } from "@vue/test-utils";
5
+ var { debug, getElementLocatorSelectors } = utils;
6
6
  var mountedWrappers = /* @__PURE__ */ new Set();
7
7
  function render(Component, {
8
8
  container: customContainer,
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { render } from './pure.js';
2
2
  export { ComponentRenderOptions, RenderResult, cleanup } from './pure.js';
3
3
  export { config } from '@vue/test-utils';
4
- import '@vitest/browser/context';
4
+ import 'vitest/browser';
5
5
  import 'vue';
6
- import '@vitest/browser/utils';
7
6
 
8
- declare module '@vitest/browser/context' {
7
+ declare module 'vitest/browser' {
9
8
  interface BrowserPage {
10
9
  render: typeof render;
11
10
  }
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@ import {
2
2
  cleanup,
3
3
  config,
4
4
  render
5
- } from "./chunk-UVTFRJ6S.js";
5
+ } from "./chunk-4TGQYMZ3.js";
6
6
 
7
7
  // src/index.ts
8
- import { page } from "@vitest/browser/context";
8
+ import { page } from "vitest/browser";
9
9
  import { beforeEach } from "vitest";
10
10
  page.extend({
11
11
  render,
package/dist/pure.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { LocatorSelectors, Locator } from '@vitest/browser/context';
1
+ import { LocatorSelectors, Locator, PrettyDOMOptions } from 'vitest/browser';
2
2
  import { ComponentMountingOptions } from '@vue/test-utils';
3
3
  export { config } from '@vue/test-utils';
4
4
  import { DefineComponent } from 'vue';
5
- import { PrettyDOMOptions } from '@vitest/browser/utils';
6
5
 
7
6
  type ComponentProps<T> = T extends new (...angs: any) => {
8
7
  $props: infer P;
package/dist/pure.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  cleanup,
3
3
  config,
4
4
  render
5
- } from "./chunk-UVTFRJ6S.js";
5
+ } from "./chunk-4TGQYMZ3.js";
6
6
  export {
7
7
  cleanup,
8
8
  config,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest-browser-vue",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "2.0.0",
5
5
  "description": "Render Vue components in Vitest Browser Mode",
6
6
  "author": "Vitest Team",
7
7
  "license": "MIT",
@@ -28,7 +28,8 @@
28
28
  "./pure": {
29
29
  "types": "./dist/pure.d.ts",
30
30
  "default": "./dist/pure.js"
31
- }
31
+ },
32
+ "./package.json": "./package.json"
32
33
  },
33
34
  "main": "./dist/index.js",
34
35
  "module": "./dist/index.js",
@@ -38,12 +39,8 @@
38
39
  "*.mjs",
39
40
  "dist"
40
41
  ],
41
- "engines": {
42
- "node": "^18.0.0 || >=20.0.0"
43
- },
44
42
  "peerDependencies": {
45
- "@vitest/browser": "^2.1.0 || ^3.0.0 || ^4.0.0-0",
46
- "vitest": "^2.1.0 || ^3.0.0 || ^4.0.0-0",
43
+ "vitest": "^4.0.0-0",
47
44
  "vue": "^3.0.0"
48
45
  },
49
46
  "dependencies": {
@@ -52,15 +49,15 @@
52
49
  "devDependencies": {
53
50
  "@antfu/eslint-config": "^2.24.1",
54
51
  "@vitejs/plugin-vue": "^5.1.2",
55
- "@vitest/browser": "^3.0.0",
52
+ "@vitest/browser-playwright": "^4.0.0-beta.15",
56
53
  "bumpp": "^9.4.2",
57
54
  "changelogithub": "^0.13.9",
58
55
  "eslint": "^9.8.0",
59
- "playwright": "^1.46.0",
56
+ "playwright": "^1.55.1",
60
57
  "tsup": "^8.2.4",
61
58
  "tsx": "^4.16.5",
62
59
  "typescript": "^5.5.4",
63
- "vitest": "^3.0.0",
60
+ "vitest": "^4.0.0-beta.15",
64
61
  "vue": "^3.4.35",
65
62
  "zx": "^8.1.4"
66
63
  },