@testforgejs/vue-test-preset-recommended 1.0.0-beta.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/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ The MIT License (MIT)
2
+ Copyright © 2026 Roman Levchenko
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # @testforgejs/vue-test-preset-recommended
2
+
3
+ Recommended presets for the [TestForge](https://github.com/testforgejs/testforge) Vue 3 component testing framework.
4
+
5
+ This package provides ready-to-use TestForge presets with sensible defaults for commonly used Vue plugins.
6
+
7
+ ## Installation
8
+
9
+ Choose your preferred package manager.
10
+
11
+ ### pnpm
12
+
13
+ ```bash
14
+ pnpm add -D @testforgejs/vue-test-preset-recommended@beta
15
+ ```
16
+
17
+ ### npm
18
+
19
+ ```bash
20
+ npm install -D @testforgejs/vue-test-preset-recommended@beta
21
+ ```
22
+
23
+ ### Yarn
24
+
25
+ ```bash
26
+ yarn add -D @testforgejs/vue-test-preset-recommended@beta
27
+ ```
28
+
29
+ > `@testforgejs/vue-test-core` is required.
30
+
31
+ ## Quick Usage
32
+
33
+ Import the `presets` object and pass it to `createTestFramework()`:
34
+
35
+ ```typescript
36
+ // tests/setup.ts
37
+ import { createTestFramework } from "@testforgejs/vue-test-core";
38
+ import { presets } from "@testforgejs/vue-test-preset-recommended";
39
+
40
+ const { testComponentFactory } = createTestFramework({
41
+ presets,
42
+ });
43
+
44
+ export { testComponentFactory };
45
+ ```
46
+
47
+ You can then use `testComponentFactory` in your component tests:
48
+
49
+ ```typescript
50
+ import { describe, expect, it } from "vitest";
51
+ import { testComponentFactory } from "./setup";
52
+ import MyComponent from "./MyComponent.vue";
53
+
54
+ describe("MyComponent", () => {
55
+ it("renders", () => {
56
+ const factory = testComponentFactory(MyComponent);
57
+ const wrapper = factory();
58
+
59
+ expect(wrapper.exists()).toBe(true);
60
+ });
61
+ });
62
+ ```
63
+
64
+ ## Available Presets
65
+
66
+ The package currently exports the following presets:
67
+
68
+ ### `presets.default`
69
+
70
+ The default recommended preset enables the following managed plugins:
71
+
72
+ - Pinia
73
+ - Vue I18n
74
+ - Vue Router — disabled by default
75
+
76
+ It also provides default configuration for Pinia, Vue I18n, and Vue Router.
77
+
78
+ ```typescript
79
+ const { testComponentFactory } = createTestFramework({
80
+ presets: {
81
+ default: presets.default,
82
+ },
83
+ });
84
+ ```
85
+
86
+ ### `presets.i18nPreset`
87
+
88
+ A minimal preset for tests that require Vue I18n.
89
+
90
+ It enables Vue I18n with:
91
+
92
+ - Composition API mode (`legacy: false`);
93
+ - English locale;
94
+ - English fallback locale;
95
+ - empty messages;
96
+ - disabled missing-translation warnings.
97
+
98
+ ```typescript
99
+ const { testComponentFactory } = createTestFramework({
100
+ presets: {
101
+ default: presets.i18nPreset,
102
+ },
103
+ });
104
+ ```
105
+
106
+ ## Using a Preset with Other Framework Configuration
107
+
108
+ The exported presets can be combined with other TestForge configuration options:
109
+
110
+ ```typescript
111
+ const { testComponentFactory } = createTestFramework({
112
+ presets,
113
+ shallowByDefault: true,
114
+ });
115
+ ```
116
+
117
+ The preset provides the baseline plugin configuration, while individual factories and tests can override configuration when needed.
118
+
119
+ ## Related Packages
120
+
121
+ - [`@testforgejs/vue-test-core`](https://www.npmjs.com/package/@testforgejs/vue-test-core) — core TestForge testing framework
122
+ - [`@testforgejs/vue-test-plugin-pinia`](https://www.npmjs.com/package/@testforgejs/vue-test-plugin-pinia) — Pinia integration
123
+ - [`@testforgejs/vue-test-plugin-i18n`](https://www.npmjs.com/package/@testforgejs/vue-test-plugin-i18n) — Vue I18n integration
124
+ - [`@testforgejs/vue-test-plugin-router`](https://www.npmjs.com/package/@testforgejs/vue-test-plugin-router) — Vue Router integration
125
+
126
+ ## License
127
+
128
+ MIT
package/dist/index.cjs ADDED
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ presets: () => presets
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/defaults/defaultI18n.ts
28
+ var defaultI18n = {
29
+ legacy: false,
30
+ locale: "en",
31
+ fallbackLocale: "en",
32
+ messages: {},
33
+ fallbackWarn: false,
34
+ missingWarn: false
35
+ };
36
+
37
+ // src/defaults/defaultPinia.ts
38
+ var defaultPinia = {
39
+ initialState: {},
40
+ stubActions: false,
41
+ createSpy: void 0
42
+ };
43
+
44
+ // src/defaults/defaultRouter.ts
45
+ var import_vue_router = require("vue-router");
46
+ var isBrowser = typeof window !== "undefined";
47
+ var getDefaultRouter = () => ({
48
+ history: isBrowser ? (0, import_vue_router.createWebHistory)() : (0, import_vue_router.createMemoryHistory)(),
49
+ routes: [{ path: "/", component: { render: () => null } }]
50
+ });
51
+
52
+ // src/presets.ts
53
+ var import_vue_test_plugin_pinia = require("@testforgejs/vue-test-plugin-pinia");
54
+ var import_vue_test_plugin_i18n = require("@testforgejs/vue-test-plugin-i18n");
55
+ var import_vue_test_plugin_router = require("@testforgejs/vue-test-plugin-router");
56
+ var presets = {
57
+ default: {
58
+ manifest: [
59
+ { module: import_vue_test_plugin_pinia.piniaPlugin, enabled: true },
60
+ { module: import_vue_test_plugin_i18n.i18nPlugin, enabled: true },
61
+ { module: import_vue_test_plugin_router.routerPlugin, enabled: false }
62
+ ],
63
+ defaults: {
64
+ i18n: defaultI18n,
65
+ pinia: defaultPinia,
66
+ router: getDefaultRouter()
67
+ }
68
+ },
69
+ i18nPreset: {
70
+ manifest: [{ module: import_vue_test_plugin_i18n.i18nPlugin, enabled: true }],
71
+ defaults: {
72
+ i18n: {
73
+ legacy: false,
74
+ locale: "en",
75
+ fallbackLocale: "en",
76
+ messages: {},
77
+ fallbackWarn: false,
78
+ missingWarn: false
79
+ }
80
+ }
81
+ }
82
+ };
83
+ // Annotate the CommonJS export names for ESM import in node:
84
+ 0 && (module.exports = {
85
+ presets
86
+ });
@@ -0,0 +1,45 @@
1
+ import * as _testforgejs_vue_test_plugin_router from '@testforgejs/vue-test-plugin-router';
2
+ import * as vue_router from 'vue-router';
3
+ import * as vue_i18n from 'vue-i18n';
4
+ import * as _testforgejs_vue_test_core from '@testforgejs/vue-test-core';
5
+ import * as _testforgejs_vue_test_plugin_pinia from '@testforgejs/vue-test-plugin-pinia';
6
+ import * as pinia from 'pinia';
7
+ import { VueTestI18nOptions } from '@testforgejs/vue-test-plugin-i18n';
8
+
9
+ declare const presets: {
10
+ default: {
11
+ manifest: ({
12
+ module: _testforgejs_vue_test_core.PluginModule<pinia.Pinia, _testforgejs_vue_test_plugin_pinia.VueTestPiniaOptions>;
13
+ enabled: true;
14
+ } | {
15
+ module: _testforgejs_vue_test_core.PluginModule<vue_i18n.I18n<{}, {}, {}, string, boolean>, VueTestI18nOptions>;
16
+ enabled: true;
17
+ } | {
18
+ module: _testforgejs_vue_test_core.PluginModule<vue_router._RouterClassic, _testforgejs_vue_test_plugin_router.VueTestRouterOptions>;
19
+ enabled: false;
20
+ })[];
21
+ defaults: {
22
+ i18n: VueTestI18nOptions;
23
+ pinia: _testforgejs_vue_test_plugin_pinia.VueTestPiniaOptions;
24
+ router: _testforgejs_vue_test_plugin_router.VueTestRouterOptions;
25
+ };
26
+ };
27
+ i18nPreset: {
28
+ manifest: {
29
+ module: _testforgejs_vue_test_core.PluginModule<vue_i18n.I18n<{}, {}, {}, string, boolean>, VueTestI18nOptions>;
30
+ enabled: true;
31
+ }[];
32
+ defaults: {
33
+ i18n: {
34
+ legacy: false;
35
+ locale: string;
36
+ fallbackLocale: string;
37
+ messages: {};
38
+ fallbackWarn: false;
39
+ missingWarn: false;
40
+ };
41
+ };
42
+ };
43
+ };
44
+
45
+ export { presets };
@@ -0,0 +1,45 @@
1
+ import * as _testforgejs_vue_test_plugin_router from '@testforgejs/vue-test-plugin-router';
2
+ import * as vue_router from 'vue-router';
3
+ import * as vue_i18n from 'vue-i18n';
4
+ import * as _testforgejs_vue_test_core from '@testforgejs/vue-test-core';
5
+ import * as _testforgejs_vue_test_plugin_pinia from '@testforgejs/vue-test-plugin-pinia';
6
+ import * as pinia from 'pinia';
7
+ import { VueTestI18nOptions } from '@testforgejs/vue-test-plugin-i18n';
8
+
9
+ declare const presets: {
10
+ default: {
11
+ manifest: ({
12
+ module: _testforgejs_vue_test_core.PluginModule<pinia.Pinia, _testforgejs_vue_test_plugin_pinia.VueTestPiniaOptions>;
13
+ enabled: true;
14
+ } | {
15
+ module: _testforgejs_vue_test_core.PluginModule<vue_i18n.I18n<{}, {}, {}, string, boolean>, VueTestI18nOptions>;
16
+ enabled: true;
17
+ } | {
18
+ module: _testforgejs_vue_test_core.PluginModule<vue_router._RouterClassic, _testforgejs_vue_test_plugin_router.VueTestRouterOptions>;
19
+ enabled: false;
20
+ })[];
21
+ defaults: {
22
+ i18n: VueTestI18nOptions;
23
+ pinia: _testforgejs_vue_test_plugin_pinia.VueTestPiniaOptions;
24
+ router: _testforgejs_vue_test_plugin_router.VueTestRouterOptions;
25
+ };
26
+ };
27
+ i18nPreset: {
28
+ manifest: {
29
+ module: _testforgejs_vue_test_core.PluginModule<vue_i18n.I18n<{}, {}, {}, string, boolean>, VueTestI18nOptions>;
30
+ enabled: true;
31
+ }[];
32
+ defaults: {
33
+ i18n: {
34
+ legacy: false;
35
+ locale: string;
36
+ fallbackLocale: string;
37
+ messages: {};
38
+ fallbackWarn: false;
39
+ missingWarn: false;
40
+ };
41
+ };
42
+ };
43
+ };
44
+
45
+ export { presets };
package/dist/index.js ADDED
@@ -0,0 +1,59 @@
1
+ // src/defaults/defaultI18n.ts
2
+ var defaultI18n = {
3
+ legacy: false,
4
+ locale: "en",
5
+ fallbackLocale: "en",
6
+ messages: {},
7
+ fallbackWarn: false,
8
+ missingWarn: false
9
+ };
10
+
11
+ // src/defaults/defaultPinia.ts
12
+ var defaultPinia = {
13
+ initialState: {},
14
+ stubActions: false,
15
+ createSpy: void 0
16
+ };
17
+
18
+ // src/defaults/defaultRouter.ts
19
+ import { createMemoryHistory, createWebHistory } from "vue-router";
20
+ var isBrowser = typeof window !== "undefined";
21
+ var getDefaultRouter = () => ({
22
+ history: isBrowser ? createWebHistory() : createMemoryHistory(),
23
+ routes: [{ path: "/", component: { render: () => null } }]
24
+ });
25
+
26
+ // src/presets.ts
27
+ import { piniaPlugin } from "@testforgejs/vue-test-plugin-pinia";
28
+ import { i18nPlugin } from "@testforgejs/vue-test-plugin-i18n";
29
+ import { routerPlugin } from "@testforgejs/vue-test-plugin-router";
30
+ var presets = {
31
+ default: {
32
+ manifest: [
33
+ { module: piniaPlugin, enabled: true },
34
+ { module: i18nPlugin, enabled: true },
35
+ { module: routerPlugin, enabled: false }
36
+ ],
37
+ defaults: {
38
+ i18n: defaultI18n,
39
+ pinia: defaultPinia,
40
+ router: getDefaultRouter()
41
+ }
42
+ },
43
+ i18nPreset: {
44
+ manifest: [{ module: i18nPlugin, enabled: true }],
45
+ defaults: {
46
+ i18n: {
47
+ legacy: false,
48
+ locale: "en",
49
+ fallbackLocale: "en",
50
+ messages: {},
51
+ fallbackWarn: false,
52
+ missingWarn: false
53
+ }
54
+ }
55
+ }
56
+ };
57
+ export {
58
+ presets
59
+ };
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@testforgejs/vue-test-preset-recommended",
3
+ "version": "1.0.0-beta.0",
4
+ "type": "module",
5
+ "description": "Official recommended preset for getting started with the TestForge framework",
6
+ "homepage": "https://github.com/testforgejs/testforge#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/testforgejs/testforge.git",
10
+ "directory": "packages/vue-test-preset-recommended"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/testforgejs/testforge/issues"
14
+ },
15
+ "main": "./dist/index.cjs",
16
+ "module": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js",
22
+ "require": "./dist/index.cjs"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "keywords": [
32
+ "vue",
33
+ "vue3",
34
+ "testing",
35
+ "component-testing",
36
+ "vue-test-utils",
37
+ "preset",
38
+ "configuration",
39
+ "recommended",
40
+ "testforge",
41
+ "testforge-preset"
42
+ ],
43
+ "license": "MIT",
44
+ "author": "Roman Levchenko",
45
+ "dependencies": {
46
+ "@testforgejs/vue-test-plugin-pinia": "1.0.0-beta.0",
47
+ "@testforgejs/vue-test-plugin-i18n": "1.0.0-beta.0",
48
+ "@testforgejs/vue-test-plugin-router": "1.0.0-beta.0"
49
+ },
50
+ "peerDependencies": {
51
+ "@testforgejs/vue-test-core": "1.0.0-beta.0"
52
+ },
53
+ "devDependencies": {
54
+ "@testforgejs/vue-test-core": "1.0.0-beta.0"
55
+ },
56
+ "scripts": {
57
+ "build": "tsup",
58
+ "dev": "tsup --watch"
59
+ }
60
+ }