@reventlessdev/reventless-local 3.0.0-alpha.243 → 3.0.0-alpha.245
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/CHANGELOG.md +19 -0
- package/package.json +11 -11
- package/src/LocalPlatformRegistry.res +54 -63
- package/src/LocalPlatformRegistry.res.mjs +24 -5
- package/src/LocalPlatformStart.res +84 -0
- package/src/LocalPlatformStart.res.mjs +99 -0
- package/src/Platform.res +16 -0
- package/src/Platform.res.mjs +11 -2
- package/src/adapter/LocalBus.res +30 -27
- package/src/adapter/LocalBus.res.mjs +14 -18
- package/src/adapter/LocalEventTap.res +139 -0
- package/src/adapter/LocalEventTap.res.mjs +177 -0
- package/tests/EventTapSocketFixtures.mjs +17 -0
- package/tests/LocalEventTapTest.res +154 -0
- package/tests/LocalEventTapTest.res.mjs +140 -0
- package/tests/LocalPlatformRegistryTest.res +61 -0
- package/tests/LocalPlatformRegistryTest.res.mjs +41 -1
- package/tests/LocalPlatformStartTest.res +176 -0
- package/tests/LocalPlatformStartTest.res.mjs +210 -0
- package/tests/adapter/EventTapTest.res +16 -6
- package/tests/adapter/EventTapTest.res.mjs +5 -1
|
@@ -73,8 +73,12 @@ globalThis.describe("LocalBus event tap (Phase 9)", () => {
|
|
|
73
73
|
let obj = Stdlib_Option.getOrThrow(Stdlib_JSON.Decode.object(json), undefined);
|
|
74
74
|
globalThis.expect(Stdlib_Option.flatMap(obj["event"], Stdlib_JSON.Decode.string)).toEqual("domainEvent");
|
|
75
75
|
globalThis.expect(Stdlib_Option.flatMap(obj["topic"], Stdlib_JSON.Decode.string)).toEqual("CatalogEventTopic");
|
|
76
|
-
globalThis.expect(Stdlib_Option.flatMap(obj["seq"], Stdlib_JSON.Decode.float)).toEqual(1.0);
|
|
77
76
|
globalThis.expect(Stdlib_Option.isSome(obj["payload"])).toBe(true);
|
|
77
|
+
let seqOf = line => {
|
|
78
|
+
let j = line.slice(sentinel.length, line.length);
|
|
79
|
+
return Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_Option.getOrThrow(Stdlib_JSON.Decode.object(JSON.parse(j)), undefined)["seq"], Stdlib_JSON.Decode.float), 0);
|
|
80
|
+
};
|
|
81
|
+
globalThis.expect(seqOf(lines[1]) - seqOf(first)).toEqual(1);
|
|
78
82
|
});
|
|
79
83
|
globalThis.test("tap emits even when the topic has no subscribers", async () => {
|
|
80
84
|
process.env["REVENTLESS_EVENT_TAP"] = "ndjson";
|