@sungen/driver-mock 3.2.21 → 3.2.22-beta.2
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": "@sungen/driver-mock",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.22-beta.2",
|
|
4
4
|
"description": "Sungen Mock capability (Network Mocking) — the @mock tag, mocks.yaml catalog, mock-install/call-count steps, and the specs/mock.ts runtime template. Plugs into @sun-asterisk/sungen via the capability SPI.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"author": "eqe team (engineer & quality) — Sun Asterisk",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@sun-asterisk/sungen": "3.2.
|
|
16
|
+
"@sun-asterisk/sungen": "3.2.22-beta.2"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
@@ -62,6 +62,13 @@ export const mockPatterns: StepPattern[] = [
|
|
|
62
62
|
{
|
|
63
63
|
name: 'mock-install',
|
|
64
64
|
matcher: (step) => reInstallMasked.test(step.text),
|
|
65
|
+
// Web-only (D4): `mock.install` is Playwright route interception (page.route) — there is no
|
|
66
|
+
// mobile/Appium equivalent. Declaring `platforms` gates this BEFORE the generator ever runs
|
|
67
|
+
// (PatternRegistry.platformMiss, checked pre-template-lookup), so a mobile match compiles to a
|
|
68
|
+
// named SG-W020 + loud runtime throw instead of silently emitting `mock.install(page, …)` with
|
|
69
|
+
// no `page` and no import on mobile.
|
|
70
|
+
platforms: ['web'],
|
|
71
|
+
platformAlternative: 'use `@api` or `@query` to stub/verify via the real API/DB instead',
|
|
65
72
|
generator: (step, context) => {
|
|
66
73
|
const name = mockName(step.text);
|
|
67
74
|
const entry = resolveMock(name, context.screenName || context.featureName || '', process.cwd());
|
|
@@ -75,6 +82,10 @@ export const mockPatterns: StepPattern[] = [
|
|
|
75
82
|
{
|
|
76
83
|
name: 'mock-call-count',
|
|
77
84
|
matcher: (step) => reCallCountMasked.test(step.text),
|
|
85
|
+
// Web-only (D4) — see `mock-install` above; `mock.callCount` reads the same Playwright route
|
|
86
|
+
// interception state, which mobile never installs.
|
|
87
|
+
platforms: ['web'],
|
|
88
|
+
platformAlternative: 'use `@api` or `@query` to stub/verify via the real API/DB instead',
|
|
78
89
|
generator: (step, context) => {
|
|
79
90
|
const name = mockName(step.text);
|
|
80
91
|
// Compile-time validation: the name must exist in the catalog (a typo here
|