@reventlessdev/reventless-gwt 1.0.0-alpha.143 → 1.0.0-alpha.145

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 CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 1.0.0-alpha.145 (2026-08-01)
7
+
8
+ **Note:** Version bump only for package @reventlessdev/reventless-gwt
9
+
10
+
11
+
12
+
13
+
14
+ # 1.0.0-alpha.144 (2026-08-01)
15
+
16
+ ### Bug Fixes
17
+
18
+ * **gwt:** compare produced events by their encoded wire form ([f773062](https://github.com/ReventlessDev/reventless-core/commit/f773062bc8ea18bf12e5611fcbad81aa4f1bd1b2))
19
+
20
+
6
21
  # 1.0.0-alpha.143 (2026-07-31)
7
22
 
8
23
  **Note:** Version bump only for package @reventlessdev/reventless-gwt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-gwt",
3
- "version": "1.0.0-alpha.143",
3
+ "version": "1.0.0-alpha.145",
4
4
  "description": "Given-When-Then DSLs and test harness for Reventless slice testing",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -17,9 +17,9 @@
17
17
  "@reventlessdev/rescript-effect": "0.1.0-alpha.32",
18
18
  "@reventlessdev/rescript-jest": "1.0.0-alpha.10",
19
19
  "@reventlessdev/rescript-node": "2.0.0-alpha.0",
20
- "@reventlessdev/reventless-core": "3.0.0-alpha.196",
21
- "@reventlessdev/reventless-infra": "3.0.0-alpha.114",
22
- "@reventlessdev/reventless-spec": "3.0.0-alpha.89"
20
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.115",
21
+ "@reventlessdev/reventless-core": "3.0.0-alpha.198",
22
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.90"
23
23
  },
24
24
  "devDependencies": {
25
25
  "rescript": "12.3.0",
@@ -153,10 +153,22 @@ module AssertionCore = (Spec: CoreSpec) => {
153
153
  )
154
154
  }
155
155
 
156
+ // Events are compared by their **encoded (wire) form**, not by ReScript
157
+ // structural equality. For an event-sourced system the serialized event *is*
158
+ // its identity: two events that reverse-convert to the same JSON are the same
159
+ // event. Raw `==` is stricter than that — it distinguishes an optional field
160
+ // that is present-but-`undefined` (what a decider's `deliveryWindow: ?x`
161
+ // passthrough emits when `x` is `None`) from one whose key is absent (what a
162
+ // test literal that omits the field produces), even though sury drops a `None`
163
+ // optional either way and both hit the log identically. Comparing on `encEvents`
164
+ // unifies that spurious difference, so an optional event field can be omitted in
165
+ // the expectation instead of spelled out as `?None`. It is a strictly weaker
166
+ // equality: equal values still encode equally, so nothing that passed can start
167
+ // failing — it only stops the wire-invisible key asymmetry from failing a test.
156
168
  let compareEvents = (events, expectedEvents) =>
157
169
  if errors.contents->Array.length > 0 {
158
170
  unexpectedError(events)
159
- } else if events == expectedEvents {
171
+ } else if events->encEvents == expectedEvents->encEvents {
160
172
  Outcome.pass
161
173
  } else {
162
174
  Outcome.fail(
@@ -211,7 +223,8 @@ module AssertionCore = (Spec: CoreSpec) => {
211
223
  }),
212
224
  )
213
225
  | Some(_) =>
214
- if events == expectedEvents {
226
+ // Encoded comparison, for the same reason as `compareEvents` above.
227
+ if events->encEvents == expectedEvents->encEvents {
215
228
  Outcome.pass
216
229
  } else {
217
230
  Outcome.fail(
@@ -66,7 +66,7 @@ function AssertionCore(Spec) {
66
66
  let compareEvents = (events, expectedEvents) => {
67
67
  if (errors.contents.length !== 0) {
68
68
  return unexpectedError(events);
69
- } else if (Primitive_object.equal(events, expectedEvents)) {
69
+ } else if (Primitive_object.equal(events.map(encEvent), expectedEvents.map(encEvent))) {
70
70
  return Outcome$ReventlessGwt.pass;
71
71
  } else {
72
72
  return Outcome$ReventlessGwt.fail({
@@ -120,7 +120,7 @@ function AssertionCore(Spec) {
120
120
  actual: Message$ReventlessCore.encode(actual$1, Spec.errorSchema),
121
121
  actualEvents: events.map(encEvent)
122
122
  });
123
- } else if (Primitive_object.equal(events, expectedEvents)) {
123
+ } else if (Primitive_object.equal(events.map(encEvent), expectedEvents.map(encEvent))) {
124
124
  return Outcome$ReventlessGwt.pass;
125
125
  } else {
126
126
  return Outcome$ReventlessGwt.fail({
@@ -180,7 +180,7 @@ function Make(Spec) {
180
180
  actual: Message$ReventlessCore.encode(actual$1, Spec.errorSchema),
181
181
  actualEvents: events.map(encEvent)
182
182
  });
183
- } else if (Primitive_object.equal(events, expectedEvents)) {
183
+ } else if (Primitive_object.equal(events.map(encEvent), expectedEvents.map(encEvent))) {
184
184
  return Outcome$ReventlessGwt.pass;
185
185
  } else {
186
186
  return Outcome$ReventlessGwt.fail({
@@ -281,7 +281,7 @@ function Make(Spec) {
281
281
  return o;
282
282
  } else if (errors.contents.length !== 0) {
283
283
  return unexpectedError(events);
284
- } else if (Primitive_object.equal(events, expectedEvents)) {
284
+ } else if (Primitive_object.equal(events.map(encEvent), expectedEvents.map(encEvent))) {
285
285
  return Outcome$ReventlessGwt.pass;
286
286
  } else {
287
287
  return Outcome$ReventlessGwt.fail({
@@ -413,7 +413,7 @@ function MakeFromAggregate(Spec) {
413
413
  let compareEvents = (events, expectedEvents) => {
414
414
  if (errors.contents.length !== 0) {
415
415
  return unexpectedError(events);
416
- } else if (Primitive_object.equal(events, expectedEvents)) {
416
+ } else if (Primitive_object.equal(events.map(encEvent), expectedEvents.map(encEvent))) {
417
417
  return Outcome$ReventlessGwt.pass;
418
418
  } else {
419
419
  return Outcome$ReventlessGwt.fail({
@@ -467,7 +467,7 @@ function MakeFromAggregate(Spec) {
467
467
  actual: Message$ReventlessCore.encode(actual$1, Spec.errorSchema),
468
468
  actualEvents: events.map(encEvent)
469
469
  });
470
- } else if (Primitive_object.equal(events, expectedEvents)) {
470
+ } else if (Primitive_object.equal(events.map(encEvent), expectedEvents.map(encEvent))) {
471
471
  return Outcome$ReventlessGwt.pass;
472
472
  } else {
473
473
  return Outcome$ReventlessGwt.fail({