@testforgejs/vue-test-preset-recommended-jest 1.0.0-beta.1
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 +8 -0
- package/README.md +301 -0
- package/dist/index.cjs +52 -0
- package/dist/index.d.cts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +25 -0
- package/package.json +66 -0
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,301 @@
|
|
|
1
|
+
# @testforgejs/vue-test-preset-recommended-jest
|
|
2
|
+
|
|
3
|
+
Recommended **Jest** presets for the [TestForge](https://github.com/testforgejs/testforge) Vue 3 component testing framework.
|
|
4
|
+
|
|
5
|
+
This package builds on [`@testforgejs/vue-test-preset-base`](https://www.npmjs.com/package/@testforgejs/vue-test-preset-base) and provides recommended defaults for projects using **Jest**.
|
|
6
|
+
|
|
7
|
+
The main difference from the base presets is the Pinia configuration: the recommended presets configure Pinia to use Jest's `jest.fn` as its `createSpy` implementation.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Choose your preferred package manager.
|
|
12
|
+
|
|
13
|
+
### pnpm
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add -D @testforgejs/vue-test-preset-recommended-jest@beta
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### npm
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -D @testforgejs/vue-test-preset-recommended-jest@beta
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Yarn
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn add -D @testforgejs/vue-test-preset-recommended-jest@beta
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> `@testforgejs/vue-test-core` and `@testforgejs/vue-test-preset-base` are required dependencies.
|
|
32
|
+
|
|
33
|
+
## Quick Usage
|
|
34
|
+
|
|
35
|
+
Import the `presets` object and pass it to `createTestFramework()`:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
// tests/setup.ts
|
|
39
|
+
|
|
40
|
+
import { createTestFramework } from "@testforgejs/vue-test-core";
|
|
41
|
+
import { presets } from "@testforgejs/vue-test-preset-recommended-jest";
|
|
42
|
+
|
|
43
|
+
const { testComponentFactory } = createTestFramework({
|
|
44
|
+
presets,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export { testComponentFactory };
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
You can then use `testComponentFactory` in your component tests:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { describe, expect, it } from "@jest/globals";
|
|
54
|
+
import { testComponentFactory } from "./setup";
|
|
55
|
+
import MyComponent from "./MyComponent.vue";
|
|
56
|
+
|
|
57
|
+
describe("MyComponent", () => {
|
|
58
|
+
it("renders", () => {
|
|
59
|
+
const factory = testComponentFactory(MyComponent);
|
|
60
|
+
const wrapper = factory();
|
|
61
|
+
|
|
62
|
+
expect(wrapper.exists()).toBe(true);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Available Presets
|
|
68
|
+
|
|
69
|
+
The package exports four presets:
|
|
70
|
+
|
|
71
|
+
- `presets.default`
|
|
72
|
+
- `presets.piniaPreset`
|
|
73
|
+
- `presets.i18nPreset`
|
|
74
|
+
- `presets.routerPreset`
|
|
75
|
+
|
|
76
|
+
The presets are based on the corresponding presets from `@testforgejs/vue-test-preset-base`.
|
|
77
|
+
|
|
78
|
+
### `presets.default`
|
|
79
|
+
|
|
80
|
+
The default recommended Jest preset enables:
|
|
81
|
+
|
|
82
|
+
- Pinia;
|
|
83
|
+
- Vue I18n;
|
|
84
|
+
- Vue Router — disabled by default.
|
|
85
|
+
|
|
86
|
+
It also provides default option factories for these managed plugins.
|
|
87
|
+
|
|
88
|
+
For Pinia, the recommended preset additionally configures Jest's `jest.fn` as the `createSpy` implementation.
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
const { testComponentFactory } = createTestFramework({
|
|
92
|
+
presets: {
|
|
93
|
+
default: presets.default,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
This is the preset intended for most Jest-based TestForge projects.
|
|
99
|
+
|
|
100
|
+
### `presets.piniaPreset`
|
|
101
|
+
|
|
102
|
+
A minimal preset for tests that require Pinia.
|
|
103
|
+
|
|
104
|
+
It enables Pinia and configures its spy factory to use Jest:
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
const { testComponentFactory } = createTestFramework({
|
|
108
|
+
presets: {
|
|
109
|
+
default: presets.piniaPreset,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The Pinia option factory is based on the base preset and adds Jest's `jest.fn`:
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
pinia: () => ({
|
|
118
|
+
...basePiniaOptions,
|
|
119
|
+
createSpy: jest.fn,
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
This makes the Pinia preset immediately usable in Jest-based TestForge projects.
|
|
124
|
+
|
|
125
|
+
### `presets.i18nPreset`
|
|
126
|
+
|
|
127
|
+
A minimal preset for tests that require Vue I18n.
|
|
128
|
+
|
|
129
|
+
It enables Vue I18n using the base preset's default configuration:
|
|
130
|
+
|
|
131
|
+
- Composition API mode (`legacy: false`);
|
|
132
|
+
- English locale;
|
|
133
|
+
- English fallback locale;
|
|
134
|
+
- empty messages;
|
|
135
|
+
- disabled missing-translation warnings.
|
|
136
|
+
|
|
137
|
+
The plugin defaults are provided through a plugin options factory, so each pipeline context receives fresh plugin options.
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
const { testComponentFactory } = createTestFramework({
|
|
141
|
+
presets: {
|
|
142
|
+
default: presets.i18nPreset,
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### `presets.routerPreset`
|
|
148
|
+
|
|
149
|
+
A minimal preset for tests that require Vue Router.
|
|
150
|
+
|
|
151
|
+
It enables the managed Vue Router integration using the base preset's default router configuration.
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
const { testComponentFactory } = createTestFramework({
|
|
155
|
+
presets: {
|
|
156
|
+
default: presets.routerPreset,
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The router preset provides a test-oriented router configuration suitable for isolated component tests.
|
|
162
|
+
|
|
163
|
+
Its plugin defaults are provided through a plugin options factory, which produces fresh options for each pipeline context.
|
|
164
|
+
|
|
165
|
+
## Recommended vs Base Presets
|
|
166
|
+
|
|
167
|
+
`@testforgejs/vue-test-preset-base` provides runner-neutral preset definitions.
|
|
168
|
+
|
|
169
|
+
`@testforgejs/vue-test-preset-recommended-jest` builds on those presets and adds Jest-specific configuration where necessary.
|
|
170
|
+
|
|
171
|
+
In particular:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
@testforgejs/vue-test-preset-base
|
|
175
|
+
│
|
|
176
|
+
├── default
|
|
177
|
+
├── piniaPreset
|
|
178
|
+
├── i18nPreset
|
|
179
|
+
└── routerPreset
|
|
180
|
+
│
|
|
181
|
+
▼
|
|
182
|
+
@testforgejs/vue-test-preset-recommended-jest
|
|
183
|
+
│
|
|
184
|
+
├── default → adds Jest jest.fn to Pinia
|
|
185
|
+
├── piniaPreset → adds Jest jest.fn to Pinia
|
|
186
|
+
├── i18nPreset → inherited from base
|
|
187
|
+
└── routerPreset → inherited from base
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
This separation keeps the base preset independent from a particular test runner while allowing the recommended Jest preset to provide runner-specific defaults.
|
|
191
|
+
|
|
192
|
+
The Jest-specific Pinia defaults are implemented as a **plugin options factory**. The factory invokes the base Pinia options factory and adds `createSpy`:
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
const defaultJestPinia = (() => ({
|
|
196
|
+
...defaultPinia(),
|
|
197
|
+
createSpy: jest.fn,
|
|
198
|
+
})) satisfies PluginOptionsFactory<VueTestPiniaOptions>;
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The resulting factory can be reused by both the `default` and `piniaPreset` profiles.
|
|
202
|
+
|
|
203
|
+
## Switching Presets at Runtime
|
|
204
|
+
|
|
205
|
+
A **component factory invocation** can select a different registered preset using the fourth `extraOptions` argument:
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
const factory = testComponentFactory(MyComponent);
|
|
209
|
+
|
|
210
|
+
factory(
|
|
211
|
+
{},
|
|
212
|
+
{},
|
|
213
|
+
{},
|
|
214
|
+
{
|
|
215
|
+
preset: "i18nPreset",
|
|
216
|
+
},
|
|
217
|
+
);
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The selected preset defines the complete managed plugin runtime for that component factory invocation.
|
|
221
|
+
|
|
222
|
+
This allows the same TestForge framework instance to use different runtime environments without creating a separate framework instance.
|
|
223
|
+
|
|
224
|
+
For example:
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
factory(
|
|
228
|
+
{},
|
|
229
|
+
{},
|
|
230
|
+
{},
|
|
231
|
+
{
|
|
232
|
+
preset: "piniaPreset",
|
|
233
|
+
},
|
|
234
|
+
);
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
selects the Pinia-only runtime environment for that invocation.
|
|
238
|
+
|
|
239
|
+
## Customizing Presets
|
|
240
|
+
|
|
241
|
+
The recommended presets are ordinary TestForge preset definitions and can be composed with [`extendPreset()`](https://github.com/testforgejs/testforge).
|
|
242
|
+
|
|
243
|
+
For example, a project can create its own preset from the recommended default:
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
import { extendPreset } from "@testforgejs/vue-test-core";
|
|
247
|
+
import { presets as recommendedPresets } from "@testforgejs/vue-test-preset-recommended-jest";
|
|
248
|
+
|
|
249
|
+
const projectPresets = {
|
|
250
|
+
default: extendPreset(recommendedPresets.default, {
|
|
251
|
+
defaults: {
|
|
252
|
+
pinia: () => ({
|
|
253
|
+
...recommendedPresets.default.defaults.pinia(),
|
|
254
|
+
// project-specific options
|
|
255
|
+
}),
|
|
256
|
+
},
|
|
257
|
+
}),
|
|
258
|
+
};
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Because `defaults.pinia` is a plugin options factory, the base Pinia options are obtained by invoking the factory.
|
|
262
|
+
|
|
263
|
+
When extending a preset, explicitly preserve any base plugin options that should remain enabled. Managed plugin configuration is intentionally replaced when an extension provides configuration for that plugin.
|
|
264
|
+
|
|
265
|
+
For details about preset composition and configuration layering, see the [TestForge core documentation](https://github.com/testforgejs/testforge/blob/main/packages/vue-test-core/README.md).
|
|
266
|
+
|
|
267
|
+
## Using a Preset with Other Framework Configuration
|
|
268
|
+
|
|
269
|
+
The exported presets can be combined with other TestForge configuration options:
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
const { testComponentFactory } = createTestFramework({
|
|
273
|
+
presets,
|
|
274
|
+
shallowByDefault: true,
|
|
275
|
+
});
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
The preset provides the runtime plugin baseline, while individual component factory invocations and tests can override configuration when needed.
|
|
279
|
+
|
|
280
|
+
## Plugin Options Factory Isolation
|
|
281
|
+
|
|
282
|
+
The `defaults` values in the presets are **plugin options factories**, not shared plugin configuration objects.
|
|
283
|
+
|
|
284
|
+
When a plugin options factory is invoked, it produces fresh plugin options for the current pipeline context.
|
|
285
|
+
|
|
286
|
+
This keeps mutable configuration isolated between independent pipeline contexts.
|
|
287
|
+
|
|
288
|
+
This is separate from component factory isolation: `testComponentFactory()` creates a reusable function for mounting a component, while each invocation of that component factory establishes its own runtime environment.
|
|
289
|
+
|
|
290
|
+
## Related Packages
|
|
291
|
+
|
|
292
|
+
- [`@testforgejs/vue-test-core`](https://www.npmjs.com/package/@testforgejs/vue-test-core) — TestForge core framework
|
|
293
|
+
- [`@testforgejs/vue-test-preset-base`](https://www.npmjs.com/package/@testforgejs/vue-test-preset-base) — base, runner-neutral presets
|
|
294
|
+
- [`@testforgejs/vue-test-preset-recommended`](https://www.npmjs.com/package/@testforgejs/vue-test-preset-recommended) — recommended Vitest presets
|
|
295
|
+
- [`@testforgejs/vue-test-plugin-pinia`](https://www.npmjs.com/package/@testforgejs/vue-test-plugin-pinia) — Pinia integration
|
|
296
|
+
- [`@testforgejs/vue-test-plugin-i18n`](https://www.npmjs.com/package/@testforgejs/vue-test-plugin-i18n) — Vue I18n integration
|
|
297
|
+
- [`@testforgejs/vue-test-plugin-router`](https://www.npmjs.com/package/@testforgejs/vue-test-plugin-router) — Vue Router integration
|
|
298
|
+
|
|
299
|
+
## License
|
|
300
|
+
|
|
301
|
+
MIT
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
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/presets.ts
|
|
28
|
+
var import_vue_test_core = require("@testforgejs/vue-test-core");
|
|
29
|
+
var import_vue_test_preset_base = require("@testforgejs/vue-test-preset-base");
|
|
30
|
+
var import_globals = require("@jest/globals");
|
|
31
|
+
var defaultJestPinia = (() => ({
|
|
32
|
+
...(0, import_vue_test_preset_base.defaultPinia)(),
|
|
33
|
+
createSpy: import_globals.jest.fn
|
|
34
|
+
}));
|
|
35
|
+
var presets = {
|
|
36
|
+
default: (0, import_vue_test_core.extendPreset)(import_vue_test_preset_base.presets.default, {
|
|
37
|
+
defaults: {
|
|
38
|
+
pinia: defaultJestPinia
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
piniaPreset: (0, import_vue_test_core.extendPreset)(import_vue_test_preset_base.presets.piniaPreset, {
|
|
42
|
+
defaults: {
|
|
43
|
+
pinia: defaultJestPinia
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
i18nPreset: import_vue_test_preset_base.presets.i18nPreset,
|
|
47
|
+
routerPreset: import_vue_test_preset_base.presets.routerPreset
|
|
48
|
+
};
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
presets
|
|
52
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 _testforgejs_vue_test_plugin_i18n from '@testforgejs/vue-test-plugin-i18n';
|
|
4
|
+
import * as vue_i18n from 'vue-i18n';
|
|
5
|
+
import * as _testforgejs_vue_test_core from '@testforgejs/vue-test-core';
|
|
6
|
+
import { PluginOptionsFactory } from '@testforgejs/vue-test-core';
|
|
7
|
+
|
|
8
|
+
declare const presets: {
|
|
9
|
+
default: _testforgejs_vue_test_core.PresetDefinition;
|
|
10
|
+
piniaPreset: _testforgejs_vue_test_core.PresetDefinition;
|
|
11
|
+
i18nPreset: {
|
|
12
|
+
manifest: {
|
|
13
|
+
module: _testforgejs_vue_test_core.PluginModule<vue_i18n.I18n<{}, {}, {}, string, boolean>, _testforgejs_vue_test_plugin_i18n.VueTestI18nOptions>;
|
|
14
|
+
enabled: true;
|
|
15
|
+
}[];
|
|
16
|
+
defaults: {
|
|
17
|
+
i18n: PluginOptionsFactory<_testforgejs_vue_test_plugin_i18n.VueTestI18nOptions>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
routerPreset: {
|
|
21
|
+
manifest: {
|
|
22
|
+
module: _testforgejs_vue_test_core.PluginModule<vue_router._RouterClassic, _testforgejs_vue_test_plugin_router.VueTestRouterOptions>;
|
|
23
|
+
enabled: true;
|
|
24
|
+
}[];
|
|
25
|
+
defaults: {
|
|
26
|
+
router: PluginOptionsFactory<_testforgejs_vue_test_plugin_router.VueTestRouterOptions>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { presets };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 _testforgejs_vue_test_plugin_i18n from '@testforgejs/vue-test-plugin-i18n';
|
|
4
|
+
import * as vue_i18n from 'vue-i18n';
|
|
5
|
+
import * as _testforgejs_vue_test_core from '@testforgejs/vue-test-core';
|
|
6
|
+
import { PluginOptionsFactory } from '@testforgejs/vue-test-core';
|
|
7
|
+
|
|
8
|
+
declare const presets: {
|
|
9
|
+
default: _testforgejs_vue_test_core.PresetDefinition;
|
|
10
|
+
piniaPreset: _testforgejs_vue_test_core.PresetDefinition;
|
|
11
|
+
i18nPreset: {
|
|
12
|
+
manifest: {
|
|
13
|
+
module: _testforgejs_vue_test_core.PluginModule<vue_i18n.I18n<{}, {}, {}, string, boolean>, _testforgejs_vue_test_plugin_i18n.VueTestI18nOptions>;
|
|
14
|
+
enabled: true;
|
|
15
|
+
}[];
|
|
16
|
+
defaults: {
|
|
17
|
+
i18n: PluginOptionsFactory<_testforgejs_vue_test_plugin_i18n.VueTestI18nOptions>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
routerPreset: {
|
|
21
|
+
manifest: {
|
|
22
|
+
module: _testforgejs_vue_test_core.PluginModule<vue_router._RouterClassic, _testforgejs_vue_test_plugin_router.VueTestRouterOptions>;
|
|
23
|
+
enabled: true;
|
|
24
|
+
}[];
|
|
25
|
+
defaults: {
|
|
26
|
+
router: PluginOptionsFactory<_testforgejs_vue_test_plugin_router.VueTestRouterOptions>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { presets };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/presets.ts
|
|
2
|
+
import { extendPreset } from "@testforgejs/vue-test-core";
|
|
3
|
+
import { defaultPinia, presets as basePresets } from "@testforgejs/vue-test-preset-base";
|
|
4
|
+
import { jest } from "@jest/globals";
|
|
5
|
+
var defaultJestPinia = (() => ({
|
|
6
|
+
...defaultPinia(),
|
|
7
|
+
createSpy: jest.fn
|
|
8
|
+
}));
|
|
9
|
+
var presets = {
|
|
10
|
+
default: extendPreset(basePresets.default, {
|
|
11
|
+
defaults: {
|
|
12
|
+
pinia: defaultJestPinia
|
|
13
|
+
}
|
|
14
|
+
}),
|
|
15
|
+
piniaPreset: extendPreset(basePresets.piniaPreset, {
|
|
16
|
+
defaults: {
|
|
17
|
+
pinia: defaultJestPinia
|
|
18
|
+
}
|
|
19
|
+
}),
|
|
20
|
+
i18nPreset: basePresets.i18nPreset,
|
|
21
|
+
routerPreset: basePresets.routerPreset
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
presets
|
|
25
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@testforgejs/vue-test-preset-recommended-jest",
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Official recommended preset for projects using Jest 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-jest"
|
|
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
|
+
"jest",
|
|
40
|
+
"testforge",
|
|
41
|
+
"testforge-preset"
|
|
42
|
+
],
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"author": "Roman Levchenko",
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@testforgejs/vue-test-plugin-i18n": "1.0.0-beta.1",
|
|
47
|
+
"@testforgejs/vue-test-plugin-pinia": "1.0.0-beta.1",
|
|
48
|
+
"@testforgejs/vue-test-plugin-router": "1.0.0-beta.1"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@jest/globals": "^30.0.0",
|
|
52
|
+
"jest": "^30.0.0",
|
|
53
|
+
"@testforgejs/vue-test-core": "1.0.0-beta.1",
|
|
54
|
+
"@testforgejs/vue-test-preset-base": "1.0.0-beta.1"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@jest/globals": "^30.0.0",
|
|
58
|
+
"jest": "^30.0.0",
|
|
59
|
+
"@testforgejs/vue-test-core": "1.0.0-beta.1",
|
|
60
|
+
"@testforgejs/vue-test-preset-base": "1.0.0-beta.1"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsup",
|
|
64
|
+
"dev": "tsup --watch"
|
|
65
|
+
}
|
|
66
|
+
}
|