@vnejs/plugins.settings.volume 0.1.11 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.settings.volume",
3
- "version": "0.1.11",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "tsconfig.json"
19
19
  ],
20
20
  "scripts": {
21
- "test": "echo \"Error: no test specified\" && exit 1",
21
+ "test": "npx @vnejs/monorepo test",
22
22
  "build": "npx @vnejs/monorepo package",
23
23
  "publish:major:plugin": "npm run publish:major",
24
24
  "publish:minor:plugin": "npm run publish:minor",
@@ -30,13 +30,15 @@
30
30
  "author": "",
31
31
  "license": "ISC",
32
32
  "dependencies": {
33
- "@vnejs/contracts.settings.volume": "~0.1.0"
33
+ "@vnejs/contracts.settings.volume": "~0.2.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@vnejs/module.core": "~0.1.0",
37
- "@vnejs/shared": "~0.1.0"
36
+ "@vnejs/module.core": "~0.2.0",
37
+ "@vnejs/shared": "~0.2.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@vnejs/configs.ts-common": "~0.1.0"
40
+ "@vnejs/configs.ts-common": "~0.2.0",
41
+ "@vnejs/configs.vitest": "~0.2.0",
42
+ "@vnejs/test-utils": "~0.2.0"
41
43
  }
42
44
  }
@@ -0,0 +1,9 @@
1
+ import { PLUGIN_NAME, SETTINGS_KEYS } from "@vnejs/contracts.settings.volume";
2
+ import { createTestModule, registerCoreVne, registerVnePlugin } from "@vnejs/test-utils";
3
+
4
+ export const registerVolumePluginVne = () => {
5
+ registerCoreVne();
6
+ registerVnePlugin(PLUGIN_NAME, { settings: SETTINGS_KEYS });
7
+ };
8
+
9
+ export { createTestModule as createVolumeTestModule, PLUGIN_NAME, SETTINGS_KEYS };
@@ -0,0 +1,25 @@
1
+ import { beforeEach, describe, expect, it } from "vitest";
2
+
3
+ import { SUBSCRIBE_EVENTS as SETTINGS_EVENTS } from "@vnejs/contracts.core.settings";
4
+ import { spyEvent } from "@vnejs/test-utils";
5
+
6
+ import { Volume } from "../modules/volume.js";
7
+ import { createVolumeTestModule, registerVolumePluginVne, SETTINGS_KEYS } from "./setup.js";
8
+
9
+ describe("Volume", () => {
10
+ beforeEach(() => {
11
+ registerVolumePluginVne();
12
+ });
13
+
14
+ it("init registers common, audio and video volume settings", async () => {
15
+ const { module, observer } = createVolumeTestModule(Volume, { subscribe: false });
16
+ const init = spyEvent(observer, SETTINGS_EVENTS.INIT);
17
+
18
+ await (module as Volume).init();
19
+
20
+ expect(init).toHaveBeenCalledTimes(3);
21
+ expect(init).toHaveBeenCalledWith({ name: SETTINGS_KEYS.COMMON, value: 100 });
22
+ expect(init).toHaveBeenCalledWith({ name: SETTINGS_KEYS.AUDIO, value: 100 });
23
+ expect(init).toHaveBeenCalledWith({ name: SETTINGS_KEYS.VIDEO, value: 100 });
24
+ });
25
+ });
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "outDir": "dist"
6
6
  },
7
7
  "include": ["src/**/*.ts"],
8
- "exclude": ["dist", "node_modules"]
8
+ "exclude": ["dist", "node_modules", "src/tests"]
9
9
  }