@vnejs/test-utils 0.2.5 → 0.2.7

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.
@@ -8,7 +8,7 @@ import { CONSTANTS as SCENARIO_CONST, PARAMS as SCENARIO_PARAMS, PLUGIN_NAME as
8
8
  import { CONSTANTS as SETTINGS_CONST, PLUGIN_NAME as SETTINGS, SUBSCRIBE_EVENTS as SETTINGS_EVENTS } from "@vnejs/contracts.core.settings";
9
9
  import { CONSTANTS as STACK_CONST, PLUGIN_NAME as STACK, SUBSCRIBE_EVENTS as STACK_EVENTS } from "@vnejs/contracts.core.stack";
10
10
  import { CONSTANTS as STATE_CONST, PLUGIN_NAME as STATE, SUBSCRIBE_EVENTS as STATE_EVENTS } from "@vnejs/contracts.core.state";
11
- import { PARAMS as STORAGE_PARAMS, PLUGIN_NAME as STORAGE, SUBSCRIBE_EVENTS as STORAGE_EVENTS } from "@vnejs/contracts.core.storage";
11
+ import { CONSTANTS as STORAGE_CONST, PARAMS as STORAGE_PARAMS, PLUGIN_NAME as STORAGE, SUBSCRIBE_EVENTS as STORAGE_EVENTS, } from "@vnejs/contracts.core.storage";
12
12
  import { CONSTANTS as SYSTEM_CONST, PLUGIN_NAME as SYSTEM, SUBSCRIBE_EVENTS as SYSTEM_EVENTS } from "@vnejs/contracts.core.system";
13
13
  import { PLUGIN_NAME as VENDORS, SUBSCRIBE_EVENTS as VENDORS_EVENTS } from "@vnejs/contracts.core.vendors";
14
14
  import { registerVnePlugin } from "./register-vne.js";
@@ -16,7 +16,7 @@ const CORE_REGISTRATIONS = [
16
16
  { namespace: SYSTEM, shape: { constants: SYSTEM_CONST, events: SYSTEM_EVENTS } },
17
17
  { namespace: LOGS, shape: { constants: LOGS_CONST, events: LOGS_EVENTS, settings: LOGS_SETTINGS } },
18
18
  { namespace: PLATFORMS, shape: { constants: PLATFORMS_CONST, params: PLATFORMS_PARAMS } },
19
- { namespace: STORAGE, shape: { events: STORAGE_EVENTS, params: STORAGE_PARAMS } },
19
+ { namespace: STORAGE, shape: { constants: STORAGE_CONST, events: STORAGE_EVENTS, params: STORAGE_PARAMS } },
20
20
  { namespace: MEMORY, shape: { events: MEMORY_EVENTS } },
21
21
  { namespace: VENDORS, shape: { events: VENDORS_EVENTS } },
22
22
  { namespace: COMPONENTS, shape: { constants: COMPONENTS_CONST, events: COMPONENTS_EVENTS } },
@@ -3,4 +3,4 @@ export declare const stubSilentEvent: (observer: Observer, event: string, handle
3
3
  export declare const createTestObserver: () => Observer;
4
4
  export declare const stubEvent: (observer: Observer, event: string, handler?: (...args: unknown[]) => unknown) => void;
5
5
  export declare const stubLogsEmit: (observer: Observer) => void;
6
- export declare const stubVendorEvents: (observer: Observer) => void;
6
+ export declare const stubVendorEvents: (_observer: Observer) => void;
@@ -1,5 +1,4 @@
1
1
  import { SUBSCRIBE_EVENTS as LOGS_EVENTS } from "@vnejs/contracts.core.logs";
2
- import { SUBSCRIBE_EVENTS as VENDORS_EVENTS } from "@vnejs/contracts.core.vendors";
3
2
  import { Observer } from "@vnejs/observer";
4
3
  import { vi } from "vitest";
5
4
  import { stubSideEffectEvents } from "./stub-side-effect-events.js";
@@ -15,7 +14,6 @@ export const stubEvent = (observer, event, handler = () => undefined) => {
15
14
  observer.subscribe(event, (payload) => handler(payload));
16
15
  };
17
16
  export const stubLogsEmit = (observer) => stubSilentEvent(observer, LOGS_EVENTS.EMIT);
18
- export const stubVendorEvents = (observer) => {
17
+ export const stubVendorEvents = (_observer) => {
19
18
  vi.spyOn(globalThis.crypto, "randomUUID").mockReturnValue("test-uid");
20
- stubEvent(observer, VENDORS_EVENTS.CLONE, (value) => structuredClone(value));
21
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/test-utils",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Test harness utilities for @vnejs plugin modules",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,12 @@ import {
15
15
  import { CONSTANTS as SETTINGS_CONST, PLUGIN_NAME as SETTINGS, SUBSCRIBE_EVENTS as SETTINGS_EVENTS } from "@vnejs/contracts.core.settings";
16
16
  import { CONSTANTS as STACK_CONST, PLUGIN_NAME as STACK, SUBSCRIBE_EVENTS as STACK_EVENTS } from "@vnejs/contracts.core.stack";
17
17
  import { CONSTANTS as STATE_CONST, PLUGIN_NAME as STATE, SUBSCRIBE_EVENTS as STATE_EVENTS } from "@vnejs/contracts.core.state";
18
- import { PARAMS as STORAGE_PARAMS, PLUGIN_NAME as STORAGE, SUBSCRIBE_EVENTS as STORAGE_EVENTS } from "@vnejs/contracts.core.storage";
18
+ import {
19
+ CONSTANTS as STORAGE_CONST,
20
+ PARAMS as STORAGE_PARAMS,
21
+ PLUGIN_NAME as STORAGE,
22
+ SUBSCRIBE_EVENTS as STORAGE_EVENTS,
23
+ } from "@vnejs/contracts.core.storage";
19
24
  import { CONSTANTS as SYSTEM_CONST, PLUGIN_NAME as SYSTEM, SUBSCRIBE_EVENTS as SYSTEM_EVENTS } from "@vnejs/contracts.core.system";
20
25
  import { PLUGIN_NAME as VENDORS, SUBSCRIBE_EVENTS as VENDORS_EVENTS } from "@vnejs/contracts.core.vendors";
21
26
 
@@ -27,7 +32,7 @@ const CORE_REGISTRATIONS: CoreRegistration[] = [
27
32
  { namespace: SYSTEM, shape: { constants: SYSTEM_CONST, events: SYSTEM_EVENTS } },
28
33
  { namespace: LOGS, shape: { constants: LOGS_CONST, events: LOGS_EVENTS, settings: LOGS_SETTINGS } },
29
34
  { namespace: PLATFORMS, shape: { constants: PLATFORMS_CONST, params: PLATFORMS_PARAMS } },
30
- { namespace: STORAGE, shape: { events: STORAGE_EVENTS, params: STORAGE_PARAMS } },
35
+ { namespace: STORAGE, shape: { constants: STORAGE_CONST, events: STORAGE_EVENTS, params: STORAGE_PARAMS } },
31
36
  { namespace: MEMORY, shape: { events: MEMORY_EVENTS } },
32
37
  { namespace: VENDORS, shape: { events: VENDORS_EVENTS } },
33
38
  { namespace: COMPONENTS, shape: { constants: COMPONENTS_CONST, events: COMPONENTS_EVENTS } },
package/src/stub-event.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { SUBSCRIBE_EVENTS as LOGS_EVENTS } from "@vnejs/contracts.core.logs";
2
- import { SUBSCRIBE_EVENTS as VENDORS_EVENTS } from "@vnejs/contracts.core.vendors";
3
2
  import { Observer } from "@vnejs/observer";
4
3
  import { vi } from "vitest";
5
4
 
@@ -23,7 +22,6 @@ export const stubEvent = (observer: Observer, event: string, handler: (...args:
23
22
 
24
23
  export const stubLogsEmit = (observer: Observer) => stubSilentEvent(observer, LOGS_EVENTS.EMIT);
25
24
 
26
- export const stubVendorEvents = (observer: Observer) => {
25
+ export const stubVendorEvents = (_observer: Observer) => {
27
26
  vi.spyOn(globalThis.crypto, "randomUUID").mockReturnValue("test-uid" as ReturnType<Crypto["randomUUID"]>);
28
- stubEvent(observer, VENDORS_EVENTS.CLONE, (value) => structuredClone(value));
29
27
  };