vitest-browser-vue 0.1.0 → 0.2.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
@@ -57,6 +57,18 @@ test('counter button increments the count', async () => {
57
57
 
58
58
  Unlike `@testing-library/vue`, `vitest-browser-vue` cleans up the component before the test starts instead of after, so you can see the rendered result in your UI. To avoid auto-cleanup, import the `render` function from `vitest-browser-vue/pure`.
59
59
 
60
+ ## Configuration
61
+
62
+ You can change the global configuration by modifying the `config` export. You can import it from both `vitest-browser-vue` and `vitest-browser-vue/pure`. See [documentation](https://test-utils.vuejs.org/api/#config).
63
+
64
+ ```js
65
+ import { config } from 'vitest-browser-vue'
66
+
67
+ config.global.mocks = {
68
+ $t: text => text
69
+ }
70
+ ```
71
+
60
72
  ## Special thanks
61
73
 
62
74
  - Powered by [`@vue/test-utils`](https://github.com/vuejs/test-utils/)
@@ -1,6 +1,7 @@
1
1
  // src/pure.ts
2
2
  import { mount } from "@vue/test-utils";
3
3
  import { debug, getElementLocatorSelectors } from "@vitest/browser/utils";
4
+ import { config } from "@vue/test-utils";
4
5
  var mountedWrappers = /* @__PURE__ */ new Set();
5
6
  function render(Component, {
6
7
  container: customContainer,
@@ -44,5 +45,6 @@ function unwrapNode(node) {
44
45
 
45
46
  export {
46
47
  render,
47
- cleanup
48
+ cleanup,
49
+ config
48
50
  };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { render } from './pure.js';
2
2
  export { ComponentRenderOptions, RenderResult, cleanup } from './pure.js';
3
+ export { config } from '@vue/test-utils';
3
4
  import '@vitest/browser/context';
4
- import '@vue/test-utils';
5
5
  import 'vue';
6
6
  import '@vitest/browser/utils';
7
7
 
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  cleanup,
3
+ config,
3
4
  render
4
- } from "./chunk-S4673CTL.js";
5
+ } from "./chunk-ELIMMUCX.js";
5
6
 
6
7
  // src/index.ts
7
8
  import { page } from "@vitest/browser/context";
@@ -15,5 +16,6 @@ beforeEach(() => {
15
16
  });
16
17
  export {
17
18
  cleanup,
19
+ config,
18
20
  render
19
21
  };
package/dist/pure.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { LocatorSelectors, Locator } from '@vitest/browser/context';
2
2
  import { ComponentMountingOptions } from '@vue/test-utils';
3
+ export { config } from '@vue/test-utils';
3
4
  import { DefineComponent } from 'vue';
4
5
  import { PrettyDOMOptions } from '@vitest/browser/utils';
5
6
 
package/dist/pure.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  cleanup,
3
+ config,
3
4
  render
4
- } from "./chunk-S4673CTL.js";
5
+ } from "./chunk-ELIMMUCX.js";
5
6
  export {
6
7
  cleanup,
8
+ config,
7
9
  render
8
10
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest-browser-vue",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.2.0",
5
5
  "description": "Render Vue components in Vitest Browser Mode",
6
6
  "author": "Vitest Team",
7
7
  "license": "MIT",