@testforgejs/vue-test-plugin-router 1.0.0-beta.0 → 1.0.0-beta.2
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 +17 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ yarn add -D @testforgejs/vue-test-plugin-router@beta
|
|
|
30
30
|
|
|
31
31
|
Register `routerPlugin` in the TestForge plugin manifest.
|
|
32
32
|
|
|
33
|
-
```
|
|
33
|
+
```typescript
|
|
34
34
|
import { createTestFramework } from "@testforgejs/vue-test-core";
|
|
35
35
|
import { routerPlugin } from "@testforgejs/vue-test-plugin-router";
|
|
36
36
|
|
|
@@ -43,6 +43,16 @@ const framework = createTestFramework({
|
|
|
43
43
|
enabled: true,
|
|
44
44
|
},
|
|
45
45
|
],
|
|
46
|
+
defaults: {
|
|
47
|
+
router: () => ({
|
|
48
|
+
routes: [
|
|
49
|
+
{
|
|
50
|
+
path: "/",
|
|
51
|
+
component: { render: () => null },
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
}),
|
|
55
|
+
},
|
|
46
56
|
},
|
|
47
57
|
},
|
|
48
58
|
});
|
|
@@ -52,6 +62,12 @@ const factory = framework.testComponentFactory(MyComponent);
|
|
|
52
62
|
const wrapper = factory();
|
|
53
63
|
```
|
|
54
64
|
|
|
65
|
+
`defaults.router` is an options factory. Each invocation produces a fresh Vue Router options object for the current pipeline context.
|
|
66
|
+
|
|
67
|
+
The default configuration provides a minimal `/` route so that Vue Router is ready to use without requiring application-specific routes.
|
|
68
|
+
|
|
69
|
+
For tests that depend on application routes, [create a project-specific preset](https://github.com/testforgejs/testforge/blob/main/docs/preset-authoring-guide.md) that provides the router configuration required by the application.
|
|
70
|
+
|
|
55
71
|
The plugin provides Vue Router integration for components mounted through TestForge.
|
|
56
72
|
|
|
57
73
|
## Supported versions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testforgejs/vue-test-plugin-router",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Official TestForge plugin for Vue Router integration in component tests",
|
|
6
6
|
"homepage": "https://github.com/testforgejs/testforge#readme",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"author": "Roman Levchenko",
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"vue-router": ">=4.0.0 <6.0.0",
|
|
48
|
-
"@testforgejs/vue-test-core": "1.0.0-beta.
|
|
48
|
+
"@testforgejs/vue-test-core": "1.0.0-beta.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"vue-router": "^5.0.0",
|
|
52
|
-
"@testforgejs/vue-test-core": "1.0.0-beta.
|
|
52
|
+
"@testforgejs/vue-test-core": "1.0.0-beta.2"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsup",
|