@testforgejs/vue-test-core 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 +8 -0
- package/README.md +121 -0
- package/dist/index.cjs +864 -0
- package/dist/index.d.cts +194 -0
- package/dist/index.d.ts +194 -0
- package/dist/index.js +831 -0
- package/package.json +67 -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,121 @@
|
|
|
1
|
+
# @testforgejs/vue-test-core
|
|
2
|
+
|
|
3
|
+
> Core runtime & declarative testing infrastructure for Vue 3
|
|
4
|
+
|
|
5
|
+
`@testforgejs/vue-test-core` is the core runtime of **TestForge**. It provides the framework for creating reusable, type-safe component test factories and coordinating managed Vue ecosystem plugins.
|
|
6
|
+
|
|
7
|
+
The core package provides:
|
|
8
|
+
|
|
9
|
+
- type-safe `testComponentFactory` instances
|
|
10
|
+
- plugin registration and lifecycle management
|
|
11
|
+
- project-level preset configuration
|
|
12
|
+
- reusable component test factories
|
|
13
|
+
- a hierarchical configuration merge pipeline (Preset → Factory → Test → Extra)
|
|
14
|
+
|
|
15
|
+
The core package itself does **not** include or configure any Vue ecosystem plugins. Plugins are provided by separate TestForge plugin packages and made available to the framework through a **preset**.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Choose your preferred package manager.
|
|
20
|
+
|
|
21
|
+
### pnpm
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm add -D @testforgejs/vue-test-core
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### npm
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -D @testforgejs/vue-test-core
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Yarn
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn add -D @testforgejs/vue-test-core
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Presets
|
|
40
|
+
|
|
41
|
+
A **preset** defines the managed plugins available to your TestForge runtime and provides their project-level default configuration.
|
|
42
|
+
|
|
43
|
+
The preset system separates the TestForge core from individual Vue ecosystem integrations. This means the core package does not need to know about Pinia, Vue Router, Vue I18n, Vuetify, PrimeVue, or other integrations unless they are explicitly registered through a preset.
|
|
44
|
+
|
|
45
|
+
TestForge provides an official recommended preset:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pnpm add -D @testforgejs/vue-test-preset-recommended
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The recommended preset provides commonly used integrations such as:
|
|
52
|
+
|
|
53
|
+
- Pinia
|
|
54
|
+
- Vue Router
|
|
55
|
+
- Vue I18n
|
|
56
|
+
|
|
57
|
+
Additional integrations, such as Vuetify and PrimeVue, are available as separate plugin packages and can be included in your own preset configuration.
|
|
58
|
+
|
|
59
|
+
> [!TIP]
|
|
60
|
+
> The recommended preset is optional. If your project requires a different set of plugins or configurations, you can create a custom preset.
|
|
61
|
+
|
|
62
|
+
👉 See the [Getting Started Guide](https://github.com/testforgejs/testforge/blob/main/docs/getting-started.md) for the recommended setup and the [Preset Authoring Guide](https://github.com/testforgejs/testforge/blob/main/docs/preset-authoring-guide.md) for custom presets.
|
|
63
|
+
|
|
64
|
+
## Quick Usage
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
// tests/setup.ts (or any other initialization file in your project)
|
|
68
|
+
import { createTestFramework } from "@testforgejs/vue-test-core";
|
|
69
|
+
import { presets } from "@testforgejs/vue-test-preset-recommended";
|
|
70
|
+
|
|
71
|
+
const { testComponentFactory } = createTestFramework({
|
|
72
|
+
presets,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export { testComponentFactory };
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The resulting `testComponentFactory` can then be imported and reused throughout your component tests.
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
// MyComponent.spec.ts (example component test)
|
|
82
|
+
import { testComponentFactory } from "@/tests/setup";
|
|
83
|
+
import MyComponent from "@/components/MyComponent.vue";
|
|
84
|
+
|
|
85
|
+
const factory = testComponentFactory(MyComponent);
|
|
86
|
+
|
|
87
|
+
test("renders correctly", () => {
|
|
88
|
+
const wrapper = factory();
|
|
89
|
+
|
|
90
|
+
expect(wrapper.exists()).toBe(true);
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
👉 For a complete walkthrough, continue with the [Getting Started Guide](https://github.com/testforgejs/testforge/blob/main/docs/getting-started.md).
|
|
95
|
+
|
|
96
|
+
## Documentation
|
|
97
|
+
|
|
98
|
+
- [Getting Started Guide](https://github.com/testforgejs/testforge/blob/main/docs/getting-started.md) — Set up TestForge in a project and create reusable component test factories.
|
|
99
|
+
- [Configuration & Advanced Usage](https://github.com/testforgejs/testforge/blob/main/docs/configuration.md) — Learn about configuration layers, merge strategies, execution flags, and plugin lifecycle behavior.
|
|
100
|
+
- [Plugin Authoring Guide](https://github.com/testforgejs/testforge/blob/main/docs/plugin-authoring-guide.md) — Create custom TestForge plugins.
|
|
101
|
+
- [Preset Authoring Guide](https://github.com/testforgejs/testforge/blob/main/docs/preset-authoring-guide.md) — Create custom presets for your project or organization.
|
|
102
|
+
|
|
103
|
+
## Project
|
|
104
|
+
|
|
105
|
+
This package is part of the **TestForge** monorepo.
|
|
106
|
+
|
|
107
|
+
- **[TestForge Project Overview](https://github.com/testforgejs/testforge#readme)** — project overview, package ecosystem, roadmap and repository information.
|
|
108
|
+
- **Repository:** https://github.com/testforgejs/testforge
|
|
109
|
+
|
|
110
|
+
## Related packages
|
|
111
|
+
|
|
112
|
+
- `@testforgejs/vue-test-preset-recommended`
|
|
113
|
+
- `@testforgejs/vue-test-plugin-router`
|
|
114
|
+
- `@testforgejs/vue-test-plugin-pinia`
|
|
115
|
+
- `@testforgejs/vue-test-plugin-i18n`
|
|
116
|
+
- `@testforgejs/vue-test-plugin-vuetify`
|
|
117
|
+
- `@testforgejs/vue-test-plugin-primevue`
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|