@junoflow/testkit 0.1.2 → 0.1.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/README.md +2 -2
- package/package.json +1 -1
- package/src/conformance.js +7 -9
package/README.md
CHANGED
|
@@ -98,8 +98,8 @@ production it hangs the supervisor on shutdown instead.
|
|
|
98
98
|
### `h.conformance()`
|
|
99
99
|
|
|
100
100
|
Checks the manifest and the module against each other: every declared surface
|
|
101
|
-
implemented, nothing undeclared exported, a listener exactly when
|
|
102
|
-
|
|
101
|
+
implemented, nothing undeclared exported, a `listener` function exactly when the
|
|
102
|
+
manifest declares a `listener` section, and every schema compiling. Returns all
|
|
103
103
|
problems rather than the first — "you declared six actions and implemented four"
|
|
104
104
|
is one fix, not four runs.
|
|
105
105
|
|
package/package.json
CHANGED
package/src/conformance.js
CHANGED
|
@@ -46,22 +46,20 @@ export function conformance(manifest, integration) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
// A listener is expected exactly when
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Object.keys(manifest.polls ?? {}).length > 0;
|
|
55
|
-
const wantsListener = hasEvents && !hasProducer;
|
|
49
|
+
// A listener is expected exactly when the manifest declares a `listener`
|
|
50
|
+
// section; the server reads it the same way. It is a declaration and not an
|
|
51
|
+
// inference from what else is absent, so a manifest gaining a new kind of
|
|
52
|
+
// event producer never changes what this line means.
|
|
53
|
+
const wantsListener = manifest.listener != null;
|
|
56
54
|
const hasListener = typeof integration?.listener === 'function';
|
|
57
55
|
if (wantsListener && !hasListener) {
|
|
58
56
|
problems.push(
|
|
59
|
-
'manifest.json declares
|
|
57
|
+
'manifest.json declares a listener, but the default export has none'
|
|
60
58
|
);
|
|
61
59
|
}
|
|
62
60
|
if (!wantsListener && hasListener) {
|
|
63
61
|
problems.push(
|
|
64
|
-
'the default export has a listener, but manifest.json declares no
|
|
62
|
+
'the default export has a listener, but manifest.json declares no "listener" section'
|
|
65
63
|
);
|
|
66
64
|
}
|
|
67
65
|
|