@testforgejs/vue-test-plugin-pinia 1.0.0-beta.4 → 1.0.0-beta.6

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/dist/index.cjs CHANGED
@@ -70,7 +70,8 @@ var piniaPlugin = {
70
70
  // Automatically sets the active Pinia instance for current test context.
71
71
  afterCreate(instance) {
72
72
  (0, import_pinia.setActivePinia)(instance);
73
- }
73
+ },
74
+ supportsInstanceReferences: true
74
75
  }),
75
76
  getDefaultOptions: defaultOptions
76
77
  };
package/dist/index.d.cts CHANGED
@@ -21,15 +21,19 @@ type MockStoresFn = (pinia: TestingPinia) => void;
21
21
  /**
22
22
  * Configuration options for the Pinia test plugin.
23
23
  *
24
- * Combines standard Pinia testing configuration (`TestingOptions` from `@pinia/testing`)
25
- * with TestForge plugin control options.
24
+ * Combines native Pinia testing options with TestForge-specific
25
+ * controls for managed plugin instances and store initialization.
26
26
  *
27
- * @see {@link TestingOptions} for configuring action stubs, initial state, and Pinia plugins.
28
- * @see {@link PluginControlOptions} for instance capturing and exposure mechanisms.
27
+ * Instance capturing is handled internally by TestForge using
28
+ * `captureInstance<TestingPinia>()`.
29
+ *
30
+ * @see `TestingOptions` from `@pinia/testing` for native Pinia testing configuration.
31
+ * @see `PluginControlOptions` from `@testforgejs/vue-test-core` for type-safe instance capturing.
29
32
  */
30
- interface VueTestPiniaOptions extends TestingOptions, PluginControlOptions<TestingPinia> {
33
+ type VueTestPiniaOptions = TestingOptions & PluginControlOptions<TestingPinia> & {
31
34
  /**
32
- * A callback function to modify the state of stores before a component is mounted.
35
+ * A callback for initializing or modifying Pinia stores after the
36
+ * testing Pinia instance is created and before the component is mounted.
33
37
  *
34
38
  * @example
35
39
  * ```ts
@@ -39,22 +43,20 @@ interface VueTestPiniaOptions extends TestingOptions, PluginControlOptions<Testi
39
43
  * mockStores: (pinia) => {
40
44
  * const store = useCounterStore(pinia);
41
45
  * store.count = 42;
42
- * }
43
- * }
44
- * }
46
+ * },
47
+ * },
48
+ * },
45
49
  * });
46
50
  * ```
47
51
  */
48
52
  mockStores?: MockStoresFn;
49
- }
53
+ };
50
54
 
51
55
  /**
52
- * Extending TestForge kernel types for Pinia integration.
56
+ * TestForge core type augmentation for Pinia integration.
53
57
  *
54
- * This module registers the Pinia configuration in the global plugin map,
55
- * which ensures strict typing of the `pinia` property within `plugins`.
56
- *
57
- * @module PiniaAugmentation
58
+ * Registers the public plugin configuration and runtime instance types
59
+ * used by TestForge's managed plugin APIs.
58
60
  */
59
61
  declare module "@testforgejs/vue-test-core" {
60
62
  /**
@@ -67,6 +69,15 @@ declare module "@testforgejs/vue-test-core" {
67
69
  */
68
70
  [PINIA_PLUGIN_NAME]: VueTestPiniaOptions;
69
71
  }
72
+ /**
73
+ * Registers the testing Pinia runtime instance type.
74
+ */
75
+ interface PluginInstanceMap {
76
+ /**
77
+ * Testing Pinia instance created by the managed `pinia` plugin.
78
+ */
79
+ [PINIA_PLUGIN_NAME]: TestingPinia;
80
+ }
70
81
  }
71
82
 
72
83
  /**
package/dist/index.d.ts CHANGED
@@ -21,15 +21,19 @@ type MockStoresFn = (pinia: TestingPinia) => void;
21
21
  /**
22
22
  * Configuration options for the Pinia test plugin.
23
23
  *
24
- * Combines standard Pinia testing configuration (`TestingOptions` from `@pinia/testing`)
25
- * with TestForge plugin control options.
24
+ * Combines native Pinia testing options with TestForge-specific
25
+ * controls for managed plugin instances and store initialization.
26
26
  *
27
- * @see {@link TestingOptions} for configuring action stubs, initial state, and Pinia plugins.
28
- * @see {@link PluginControlOptions} for instance capturing and exposure mechanisms.
27
+ * Instance capturing is handled internally by TestForge using
28
+ * `captureInstance<TestingPinia>()`.
29
+ *
30
+ * @see `TestingOptions` from `@pinia/testing` for native Pinia testing configuration.
31
+ * @see `PluginControlOptions` from `@testforgejs/vue-test-core` for type-safe instance capturing.
29
32
  */
30
- interface VueTestPiniaOptions extends TestingOptions, PluginControlOptions<TestingPinia> {
33
+ type VueTestPiniaOptions = TestingOptions & PluginControlOptions<TestingPinia> & {
31
34
  /**
32
- * A callback function to modify the state of stores before a component is mounted.
35
+ * A callback for initializing or modifying Pinia stores after the
36
+ * testing Pinia instance is created and before the component is mounted.
33
37
  *
34
38
  * @example
35
39
  * ```ts
@@ -39,22 +43,20 @@ interface VueTestPiniaOptions extends TestingOptions, PluginControlOptions<Testi
39
43
  * mockStores: (pinia) => {
40
44
  * const store = useCounterStore(pinia);
41
45
  * store.count = 42;
42
- * }
43
- * }
44
- * }
46
+ * },
47
+ * },
48
+ * },
45
49
  * });
46
50
  * ```
47
51
  */
48
52
  mockStores?: MockStoresFn;
49
- }
53
+ };
50
54
 
51
55
  /**
52
- * Extending TestForge kernel types for Pinia integration.
56
+ * TestForge core type augmentation for Pinia integration.
53
57
  *
54
- * This module registers the Pinia configuration in the global plugin map,
55
- * which ensures strict typing of the `pinia` property within `plugins`.
56
- *
57
- * @module PiniaAugmentation
58
+ * Registers the public plugin configuration and runtime instance types
59
+ * used by TestForge's managed plugin APIs.
58
60
  */
59
61
  declare module "@testforgejs/vue-test-core" {
60
62
  /**
@@ -67,6 +69,15 @@ declare module "@testforgejs/vue-test-core" {
67
69
  */
68
70
  [PINIA_PLUGIN_NAME]: VueTestPiniaOptions;
69
71
  }
72
+ /**
73
+ * Registers the testing Pinia runtime instance type.
74
+ */
75
+ interface PluginInstanceMap {
76
+ /**
77
+ * Testing Pinia instance created by the managed `pinia` plugin.
78
+ */
79
+ [PINIA_PLUGIN_NAME]: TestingPinia;
80
+ }
70
81
  }
71
82
 
72
83
  /**
package/dist/index.js CHANGED
@@ -42,7 +42,8 @@ var piniaPlugin = {
42
42
  // Automatically sets the active Pinia instance for current test context.
43
43
  afterCreate(instance) {
44
44
  setActivePinia(instance);
45
- }
45
+ },
46
+ supportsInstanceReferences: true
46
47
  }),
47
48
  getDefaultOptions: defaultOptions
48
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testforgejs/vue-test-plugin-pinia",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.6",
4
4
  "type": "module",
5
5
  "description": "Official TestForge plugin for Pinia integration in component tests",
6
6
  "homepage": "https://github.com/testforgejs/testforge#readme",
@@ -45,12 +45,12 @@
45
45
  "peerDependencies": {
46
46
  "pinia": "^3.0.0 || ^4.0.0",
47
47
  "@pinia/testing": "^1.0.0 || ^2.0.0",
48
- "@testforgejs/vue-test-core": "1.0.0-beta.3"
48
+ "@testforgejs/vue-test-core": "1.0.0-beta.5"
49
49
  },
50
50
  "devDependencies": {
51
51
  "pinia": "^4.0.0",
52
52
  "@pinia/testing": "^2.0.0",
53
- "@testforgejs/vue-test-core": "1.0.0-beta.3"
53
+ "@testforgejs/vue-test-core": "1.0.0-beta.5"
54
54
  },
55
55
  "testforge": {
56
56
  "plugin": {