@vnejs/compatibility.scenario.point_and_click-with-vars.flags 0.2.2 → 0.2.3
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.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/tests/vars.flags.test.ts +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ type PointAndClickExecHandler = (payload: {
|
|
|
4
4
|
line?: string;
|
|
5
5
|
keywords?: string[];
|
|
6
6
|
}) => unknown;
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class CompatibilityScenarioPointAndClickWithVarsFlags extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
8
8
|
name: string;
|
|
9
9
|
init: () => Promise<unknown[]> | undefined;
|
|
10
10
|
onPointAndClickExec: ({ line, keywords }?: Parameters<PointAndClickExecHandler>[0]) => Promise<unknown> | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import { regModule } from "@vnejs/shared";
|
|
3
|
-
export class
|
|
3
|
+
export class CompatibilityScenarioPointAndClickWithVarsFlags extends ModuleCore {
|
|
4
4
|
name = "compatibility.scenario.point_and_click-with-vars.flags";
|
|
5
5
|
init = () => this.emit(this.EVENTS.POINT_AND_CLICK.EXEC_REG, {
|
|
6
6
|
module: this.CONST.VARS_FLAGS.EXEC_NAME,
|
|
@@ -8,4 +8,4 @@ export class CompatibilityPointAndClickFlags extends ModuleCore {
|
|
|
8
8
|
});
|
|
9
9
|
onPointAndClickExec = ({ line = "", keywords = [] } = {}) => this.emitOne(this.EVENTS.VARS_FLAGS.EXEC_CHECK, { line, keywords });
|
|
10
10
|
}
|
|
11
|
-
regModule(
|
|
11
|
+
regModule(CompatibilityScenarioPointAndClickWithVarsFlags);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ type PointAndClickExecRegPayload = {
|
|
|
10
10
|
handler?: PointAndClickExecHandler;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export class
|
|
13
|
+
export class CompatibilityScenarioPointAndClickWithVarsFlags extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
14
14
|
name = "compatibility.scenario.point_and_click-with-vars.flags";
|
|
15
15
|
|
|
16
16
|
init = () =>
|
|
@@ -23,4 +23,4 @@ export class CompatibilityPointAndClickFlags extends ModuleCore<PluginEvents, Pl
|
|
|
23
23
|
this.emitOne(this.EVENTS.VARS_FLAGS.EXEC_CHECK, { line, keywords });
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
regModule(
|
|
26
|
+
regModule(CompatibilityScenarioPointAndClickWithVarsFlags);
|
|
@@ -2,28 +2,28 @@ import { beforeEach, describe, expect, it } from "vitest";
|
|
|
2
2
|
|
|
3
3
|
import { spyEvent } from "@vnejs/test-utils";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { CompatibilityScenarioPointAndClickWithVarsFlags } from "../index.js";
|
|
6
6
|
import { createCompatibilityTestModule, VARS_FLAGS_CONST, VARS_FLAGS_EVENTS, PAC_EVENTS, registerCompatibilityVne } from "./setup.js";
|
|
7
7
|
|
|
8
|
-
describe("
|
|
8
|
+
describe("CompatibilityScenarioPointAndClickWithVarsFlags", () => {
|
|
9
9
|
beforeEach(() => registerCompatibilityVne());
|
|
10
10
|
|
|
11
11
|
it("init registers point and click exec handler", async () => {
|
|
12
|
-
const { module, observer } = createCompatibilityTestModule(
|
|
12
|
+
const { module, observer } = createCompatibilityTestModule(CompatibilityScenarioPointAndClickWithVarsFlags, { subscribe: false });
|
|
13
13
|
const execReg = spyEvent(observer, PAC_EVENTS.EXEC_REG);
|
|
14
14
|
|
|
15
|
-
await (module as
|
|
15
|
+
await (module as CompatibilityScenarioPointAndClickWithVarsFlags).init();
|
|
16
16
|
|
|
17
17
|
expect(execReg).toHaveBeenCalledOnce();
|
|
18
18
|
expect(execReg.mock.calls[0]?.[0]).toMatchObject({ module: VARS_FLAGS_CONST.EXEC_NAME });
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
it("registered handler emits EXEC_CHECK", async () => {
|
|
22
|
-
const { module, observer } = createCompatibilityTestModule(
|
|
22
|
+
const { module, observer } = createCompatibilityTestModule(CompatibilityScenarioPointAndClickWithVarsFlags, { subscribe: false });
|
|
23
23
|
const execReg = spyEvent(observer, PAC_EVENTS.EXEC_REG);
|
|
24
24
|
const execCheck = spyEvent(observer, VARS_FLAGS_EVENTS.EXEC_CHECK);
|
|
25
25
|
|
|
26
|
-
await (module as
|
|
26
|
+
await (module as CompatibilityScenarioPointAndClickWithVarsFlags).init();
|
|
27
27
|
|
|
28
28
|
const handler = execReg.mock.calls[0]?.[0]?.handler as (payload: { line?: string; keywords?: string[] }) => unknown;
|
|
29
29
|
await handler({ line: "line", keywords: ["a"] });
|