@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 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 events have no
102
- webhook or poll to produce them, and every schema compiling. Returns all
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junoflow/testkit",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Test harness for Juno integrations",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -46,22 +46,20 @@ export function conformance(manifest, integration) {
46
46
  }
47
47
  }
48
48
 
49
- // A listener is expected exactly when events are declared with nothing else
50
- // to produce them; the server derives it the same way.
51
- const hasEvents = Object.keys(manifest.events ?? {}).length > 0;
52
- const hasProducer =
53
- Object.keys(manifest.webhooks ?? {}).length > 0 ||
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 events with no webhook or poll to produce them, so a listener is required, but the default export has none'
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 events for it to emit'
62
+ 'the default export has a listener, but manifest.json declares no "listener" section'
65
63
  );
66
64
  }
67
65