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

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
@@ -30,7 +30,10 @@ module.exports = __toCommonJS(index_exports);
30
30
  var import_vue_test_core = require("@testforgejs/vue-test-core");
31
31
  var import_testing = require("@pinia/testing");
32
32
  function createPiniaPlugin(options) {
33
- const pinia = (0, import_vue_test_core.createPluginInstance)(import_testing.createTestingPinia, options);
33
+ const pinia = (0, import_vue_test_core.createPluginInstance)(
34
+ import_testing.createTestingPinia,
35
+ options
36
+ );
34
37
  if (options.mockStores) {
35
38
  options.mockStores(pinia);
36
39
  }
package/dist/index.d.cts CHANGED
@@ -1,26 +1,33 @@
1
- import { Pinia } from 'pinia';
2
- import { TestingOptions } from '@pinia/testing';
1
+ import { TestingOptions, TestingPinia } from '@pinia/testing';
3
2
  import { PluginControlOptions, PluginModuleWithDefaults } from '@testforgejs/vue-test-core';
4
3
 
4
+ /**
5
+ * Stable TestForge identifier for the managed Pinia plugin.
6
+ *
7
+ * Use this identifier when declaring Pinia configuration
8
+ * in presets and other plugin-aware TestForge APIs.
9
+ */
5
10
  declare const PINIA_PLUGIN_NAME: "pinia";
6
11
 
7
12
  /**
8
- * A callback function to mutate or configure Pinia stores immediately after they are created.
9
- * Used to set the initial state (mocking) in tests.
13
+ * A callback for configuring Pinia stores after the testing Pinia instance
14
+ * is created and before the component is mounted.
15
+ *
16
+ * Use it to initialize or modify stores required by the test.
10
17
  *
11
- * @param pinia - Созданный инстанс Pinia для тестирования.
18
+ * @param pinia - The testing Pinia instance used by the mounted component.
12
19
  */
13
- type MockStoresFn = (pinia: Pinia) => void;
20
+ type MockStoresFn = (pinia: TestingPinia) => void;
14
21
  /**
15
22
  * Configuration options for the Pinia test plugin.
16
23
  *
17
- * This interface integrates the standard Pinia testing initialization settings
18
- * (`TestingOptions` from `@pinia/testing`) with the TestForge core configuration options.
24
+ * Combines standard Pinia testing configuration (`TestingOptions` from `@pinia/testing`)
25
+ * with TestForge plugin control options.
19
26
  *
20
- * @see {@link TestingOptions} to configure action stubs and the initial state.
21
- * @see {@link PluginControlOptions} to use interception methods such as `expose`.
27
+ * @see {@link TestingOptions} for configuring action stubs, initial state, and Pinia plugins.
28
+ * @see {@link PluginControlOptions} for instance capturing and exposure mechanisms.
22
29
  */
23
- interface VueTestPiniaOptions extends TestingOptions, PluginControlOptions<Pinia> {
30
+ interface VueTestPiniaOptions extends TestingOptions, PluginControlOptions<TestingPinia> {
24
31
  /**
25
32
  * A callback function to modify the state of stores before a component is mounted.
26
33
  *
@@ -62,6 +69,12 @@ declare module "@testforgejs/vue-test-core" {
62
69
  }
63
70
  }
64
71
 
65
- declare const piniaPlugin: PluginModuleWithDefaults<Pinia, VueTestPiniaOptions>;
72
+ /**
73
+ * Managed Pinia testing plugin module for TestForge.
74
+ *
75
+ * Provides the runtime definition for creating testing Pinia instances
76
+ * and exposes the default configuration used by TestForge-managed presets.
77
+ */
78
+ declare const piniaPlugin: PluginModuleWithDefaults<TestingPinia, VueTestPiniaOptions>;
66
79
 
67
80
  export { type MockStoresFn, PINIA_PLUGIN_NAME as PLUGIN_NAME, type VueTestPiniaOptions, piniaPlugin, piniaPlugin as plugin };
package/dist/index.d.ts CHANGED
@@ -1,26 +1,33 @@
1
- import { Pinia } from 'pinia';
2
- import { TestingOptions } from '@pinia/testing';
1
+ import { TestingOptions, TestingPinia } from '@pinia/testing';
3
2
  import { PluginControlOptions, PluginModuleWithDefaults } from '@testforgejs/vue-test-core';
4
3
 
4
+ /**
5
+ * Stable TestForge identifier for the managed Pinia plugin.
6
+ *
7
+ * Use this identifier when declaring Pinia configuration
8
+ * in presets and other plugin-aware TestForge APIs.
9
+ */
5
10
  declare const PINIA_PLUGIN_NAME: "pinia";
6
11
 
7
12
  /**
8
- * A callback function to mutate or configure Pinia stores immediately after they are created.
9
- * Used to set the initial state (mocking) in tests.
13
+ * A callback for configuring Pinia stores after the testing Pinia instance
14
+ * is created and before the component is mounted.
15
+ *
16
+ * Use it to initialize or modify stores required by the test.
10
17
  *
11
- * @param pinia - Созданный инстанс Pinia для тестирования.
18
+ * @param pinia - The testing Pinia instance used by the mounted component.
12
19
  */
13
- type MockStoresFn = (pinia: Pinia) => void;
20
+ type MockStoresFn = (pinia: TestingPinia) => void;
14
21
  /**
15
22
  * Configuration options for the Pinia test plugin.
16
23
  *
17
- * This interface integrates the standard Pinia testing initialization settings
18
- * (`TestingOptions` from `@pinia/testing`) with the TestForge core configuration options.
24
+ * Combines standard Pinia testing configuration (`TestingOptions` from `@pinia/testing`)
25
+ * with TestForge plugin control options.
19
26
  *
20
- * @see {@link TestingOptions} to configure action stubs and the initial state.
21
- * @see {@link PluginControlOptions} to use interception methods such as `expose`.
27
+ * @see {@link TestingOptions} for configuring action stubs, initial state, and Pinia plugins.
28
+ * @see {@link PluginControlOptions} for instance capturing and exposure mechanisms.
22
29
  */
23
- interface VueTestPiniaOptions extends TestingOptions, PluginControlOptions<Pinia> {
30
+ interface VueTestPiniaOptions extends TestingOptions, PluginControlOptions<TestingPinia> {
24
31
  /**
25
32
  * A callback function to modify the state of stores before a component is mounted.
26
33
  *
@@ -62,6 +69,12 @@ declare module "@testforgejs/vue-test-core" {
62
69
  }
63
70
  }
64
71
 
65
- declare const piniaPlugin: PluginModuleWithDefaults<Pinia, VueTestPiniaOptions>;
72
+ /**
73
+ * Managed Pinia testing plugin module for TestForge.
74
+ *
75
+ * Provides the runtime definition for creating testing Pinia instances
76
+ * and exposes the default configuration used by TestForge-managed presets.
77
+ */
78
+ declare const piniaPlugin: PluginModuleWithDefaults<TestingPinia, VueTestPiniaOptions>;
66
79
 
67
80
  export { type MockStoresFn, PINIA_PLUGIN_NAME as PLUGIN_NAME, type VueTestPiniaOptions, piniaPlugin, piniaPlugin as plugin };
package/dist/index.js CHANGED
@@ -2,7 +2,10 @@
2
2
  import { createPluginInstance } from "@testforgejs/vue-test-core";
3
3
  import { createTestingPinia } from "@pinia/testing";
4
4
  function createPiniaPlugin(options) {
5
- const pinia = createPluginInstance(createTestingPinia, options);
5
+ const pinia = createPluginInstance(
6
+ createTestingPinia,
7
+ options
8
+ );
6
9
  if (options.mockStores) {
7
10
  options.mockStores(pinia);
8
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testforgejs/vue-test-plugin-pinia",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.4",
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",