@reventlessdev/reventless-gwt 1.0.0-alpha.74
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 +698 -0
- package/LICENSE +202 -0
- package/bin/reventless-dev.mjs +21 -0
- package/package.json +54 -0
- package/rescript.json +36 -0
- package/src/.gwtignore +10 -0
- package/src/Automation_GWT.res +207 -0
- package/src/Automation_GWT.res.mjs +160 -0
- package/src/Behavior_GWT.res +603 -0
- package/src/Behavior_GWT.res.mjs +426 -0
- package/src/Bind.res +29 -0
- package/src/Bind.res.mjs +22 -0
- package/src/BuildClassifier.res +137 -0
- package/src/BuildClassifier.res.mjs +136 -0
- package/src/Cancellation.res +31 -0
- package/src/Cancellation.res.mjs +45 -0
- package/src/ChildProcess.res +84 -0
- package/src/ChildProcess.res.mjs +92 -0
- package/src/Cli.res +671 -0
- package/src/Cli.res.mjs +754 -0
- package/src/Collector.res +201 -0
- package/src/Collector.res.mjs +215 -0
- package/src/ComponentMeta.res +104 -0
- package/src/ComponentMeta.res.mjs +120 -0
- package/src/ComponentScan.res +103 -0
- package/src/ComponentScan.res.mjs +105 -0
- package/src/Delegate_GWT.res +303 -0
- package/src/Delegate_GWT.res.mjs +372 -0
- package/src/Diff.res +91 -0
- package/src/Diff.res.mjs +98 -0
- package/src/Discovery.res +105 -0
- package/src/Discovery.res.mjs +103 -0
- package/src/DomainDeadCode.res +93 -0
- package/src/DomainDeadCode.res.mjs +69 -0
- package/src/DomainGraph.res +0 -0
- package/src/DomainGraph.res.mjs +0 -0
- package/src/EventMapping_GWT.res +29 -0
- package/src/EventMapping_GWT.res.mjs +44 -0
- package/src/Filter.res +36 -0
- package/src/Filter.res.mjs +40 -0
- package/src/Flow_GWT.res +664 -0
- package/src/Flow_GWT.res.mjs +604 -0
- package/src/FormatterHuman.res +138 -0
- package/src/FormatterHuman.res.mjs +122 -0
- package/src/FormatterJson.res +257 -0
- package/src/FormatterJson.res.mjs +320 -0
- package/src/FormatterJunit.res +93 -0
- package/src/FormatterJunit.res.mjs +90 -0
- package/src/FormatterTap.res +139 -0
- package/src/FormatterTap.res.mjs +149 -0
- package/src/FormatterVsCode.res +362 -0
- package/src/FormatterVsCode.res.mjs +564 -0
- package/src/Hint.res +119 -0
- package/src/Hint.res.mjs +124 -0
- package/src/InboundTranslation_GWT.res +83 -0
- package/src/InboundTranslation_GWT.res.mjs +94 -0
- package/src/JestBind.res +70 -0
- package/src/JestBind.res.mjs +63 -0
- package/src/Loader.res +24 -0
- package/src/Loader.res.mjs +23 -0
- package/src/LocalHost.res +135 -0
- package/src/LocalHost.res.mjs +127 -0
- package/src/Mapping_GWT.res +474 -0
- package/src/Mapping_GWT.res.mjs +322 -0
- package/src/MultiSourceProjection_GWT.res +316 -0
- package/src/MultiSourceProjection_GWT.res.mjs +354 -0
- package/src/OutboundTranslation_GWT.res +238 -0
- package/src/OutboundTranslation_GWT.res.mjs +186 -0
- package/src/Outcome.res +161 -0
- package/src/Outcome.res.mjs +140 -0
- package/src/PackageScan.res +80 -0
- package/src/PackageScan.res.mjs +81 -0
- package/src/PlatformRunner.res +160 -0
- package/src/PlatformRunner.res.mjs +155 -0
- package/src/PlatformScan.res +138 -0
- package/src/PlatformScan.res.mjs +131 -0
- package/src/ProcessManager.res +91 -0
- package/src/ProcessManager.res.mjs +80 -0
- package/src/Projection_GWT.res +312 -0
- package/src/Projection_GWT.res.mjs +332 -0
- package/src/Query_GWT.res +379 -0
- package/src/Query_GWT.res.mjs +367 -0
- package/src/RenderRescript.res +125 -0
- package/src/RenderRescript.res.mjs +141 -0
- package/src/RunnerTypes.res +68 -0
- package/src/RunnerTypes.res.mjs +60 -0
- package/src/SideEffect_GWT.res +157 -0
- package/src/SideEffect_GWT.res.mjs +113 -0
- package/src/StateChange/ExternalAddCategorySlice.res +25 -0
- package/src/StateChange/ExternalAddCategorySlice.res.mjs +34 -0
- package/src/StateChange/ExternalAddCategorySlice_Behavior.res +19 -0
- package/src/StateChange/ExternalAddCategorySlice_Behavior.res.mjs +46 -0
- package/src/StateChange/WithFixtures.res +22 -0
- package/src/StateChange/WithFixtures.res.mjs +31 -0
- package/src/StateChange/WithFixtures_Behavior.res +17 -0
- package/src/StateChange/WithFixtures_Behavior.res.mjs +37 -0
- package/src/StateChange/WithManualOpen.res +23 -0
- package/src/StateChange/WithManualOpen.res.mjs +31 -0
- package/src/StateChange/WithManualOpen_Behavior.res +17 -0
- package/src/StateChange/WithManualOpen_Behavior.res.mjs +37 -0
- package/src/StubRuntime.res +53 -0
- package/src/StubRuntime.res.mjs +54 -0
- package/src/TestFixtures.res +16 -0
- package/src/TestFixtures.res.mjs +34 -0
- package/src/Watch.res +92 -0
- package/src/Watch.res.mjs +83 -0
- package/src/WatcherProbe.res +48 -0
- package/src/WatcherProbe.res.mjs +46 -0
- package/tests/AutomationGwtTest.res +71 -0
- package/tests/AutomationGwtTest.res.mjs +189 -0
- package/tests/BuildClassifierTest.res +94 -0
- package/tests/BuildClassifierTest.res.mjs +132 -0
- package/tests/ComponentMetaTest.res +52 -0
- package/tests/ComponentMetaTest.res.mjs +57 -0
- package/tests/DelegateGwtTest.res +487 -0
- package/tests/DelegateGwtTest.res.mjs +891 -0
- package/tests/DiscoveryTest.res +42 -0
- package/tests/DiscoveryTest.res.mjs +43 -0
- package/tests/DomainDeadCodeTest.res +116 -0
- package/tests/DomainDeadCodeTest.res.mjs +155 -0
- package/tests/DomainGraphTest.res +365 -0
- package/tests/DomainGraphTest.res.mjs +413 -0
- package/tests/FlowAggregateGwtTest.res +169 -0
- package/tests/FlowAggregateGwtTest.res.mjs +269 -0
- package/tests/FlowCrossPluginGwtTest.res +340 -0
- package/tests/FlowCrossPluginGwtTest.res.mjs +798 -0
- package/tests/FlowGwtTest.res +222 -0
- package/tests/FlowGwtTest.res.mjs +432 -0
- package/tests/FormatterVsCodeMessageTest.res +41 -0
- package/tests/FormatterVsCodeMessageTest.res.mjs +42 -0
- package/tests/InboundTranslationGwtTest.res +34 -0
- package/tests/InboundTranslationGwtTest.res.mjs +98 -0
- package/tests/LocalHostIntegration.res +70 -0
- package/tests/LocalHostIntegration.res.mjs +64 -0
- package/tests/LocalHostTest.res +71 -0
- package/tests/LocalHostTest.res.mjs +63 -0
- package/tests/MappingGwtTest.res +348 -0
- package/tests/MappingGwtTest.res.mjs +592 -0
- package/tests/OutboundTranslationGwtTest.res +59 -0
- package/tests/OutboundTranslationGwtTest.res.mjs +138 -0
- package/tests/PlatformRunnerTest.res +66 -0
- package/tests/PlatformRunnerTest.res.mjs +85 -0
- package/tests/PlatformScanTest.res +61 -0
- package/tests/PlatformScanTest.res.mjs +56 -0
- package/tests/QueryGwtTest.res +161 -0
- package/tests/QueryGwtTest.res.mjs +314 -0
- package/tests/QueryResolverGwtTest.res +71 -0
- package/tests/QueryResolverGwtTest.res.mjs +136 -0
- package/tests/RunnerUnitTest.res +219 -0
- package/tests/RunnerUnitTest.res.mjs +244 -0
- package/tests/SideEffect/FakeOrderNotification.res +23 -0
- package/tests/SideEffect/FakeOrderNotification.res.mjs +36 -0
- package/tests/SideEffect/FakeOrderNotificationGwtTest.res +35 -0
- package/tests/SideEffect/FakeOrderNotificationGwtTest.res.mjs +73 -0
- package/tests/SideEffect/MockEmail.res +18 -0
- package/tests/SideEffect/MockEmail.res.mjs +47 -0
- package/tests/StateChange/ExternalAddCategorySlice_GWT.res +27 -0
- package/tests/StateChange/ExternalAddCategorySlice_GWT.res.mjs +70 -0
- package/tests/StateChange/WithFixtures_Fixtures.res +9 -0
- package/tests/StateChange/WithFixtures_Fixtures.res.mjs +20 -0
- package/tests/StateChange/WithFixtures_GWT.res +23 -0
- package/tests/StateChange/WithFixtures_GWT.res.mjs +56 -0
- package/tests/StateChange/WithManualOpen_Fixtures.res +7 -0
- package/tests/StateChange/WithManualOpen_Fixtures.res.mjs +20 -0
- package/tests/StateChange/WithManualOpen_GWT.res +17 -0
- package/tests/StateChange/WithManualOpen_GWT.res.mjs +56 -0
- package/tests/StateChangeSliceGwtTest.res +160 -0
- package/tests/StateChangeSliceGwtTest.res.mjs +280 -0
- package/tests/StateViewSliceGwtTest.res +64 -0
- package/tests/StateViewSliceGwtTest.res.mjs +161 -0
- package/tests/WatchDebounceTest.res +78 -0
- package/tests/WatchDebounceTest.res.mjs +97 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
5
|
+
import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
|
|
6
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
7
|
+
import * as Outcome$ReventlessGwt from "./Outcome.res.mjs";
|
|
8
|
+
import * as JestBind$ReventlessGwt from "./JestBind.res.mjs";
|
|
9
|
+
import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
|
|
10
|
+
|
|
11
|
+
function Make(Spec) {
|
|
12
|
+
S.enableJson();
|
|
13
|
+
let test = (name, body) => JestBind$ReventlessGwt.test(Spec.name, name, body);
|
|
14
|
+
let encTodos = arr => arr.map(param => [
|
|
15
|
+
param[0],
|
|
16
|
+
Message$ReventlessCore.encode(param[1], Spec.todoItemSchema)
|
|
17
|
+
]);
|
|
18
|
+
let givenEvent = e => e;
|
|
19
|
+
let whenCollect = e => Spec.collect(e);
|
|
20
|
+
let thenTodos = (actual, expected) => {
|
|
21
|
+
if (Primitive_object.equal(actual, expected)) {
|
|
22
|
+
return Outcome$ReventlessGwt.pass;
|
|
23
|
+
} else {
|
|
24
|
+
return Outcome$ReventlessGwt.fail({
|
|
25
|
+
TAG: "TodoMismatch",
|
|
26
|
+
expected: encTodos(expected),
|
|
27
|
+
actual: encTodos(actual)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
let whenResolve = e => Spec.resolve(e);
|
|
32
|
+
let thenResolved = (actual, expected) => {
|
|
33
|
+
if (Primitive_object.equal(actual, expected)) {
|
|
34
|
+
return Outcome$ReventlessGwt.pass;
|
|
35
|
+
}
|
|
36
|
+
let asPair = opt => {
|
|
37
|
+
if (opt !== undefined) {
|
|
38
|
+
return [[
|
|
39
|
+
Primitive_option.valFromOption(opt),
|
|
40
|
+
null
|
|
41
|
+
]];
|
|
42
|
+
} else {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return Outcome$ReventlessGwt.fail({
|
|
47
|
+
TAG: "TodoMismatch",
|
|
48
|
+
expected: asPair(expected),
|
|
49
|
+
actual: asPair(actual)
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
let givenTodo = (id, todo) => [
|
|
53
|
+
id,
|
|
54
|
+
todo
|
|
55
|
+
];
|
|
56
|
+
let whenProcess = param => Spec.process(param[0], param[1]);
|
|
57
|
+
let thenCommand = (actual, expectedId, expectedCmd) => {
|
|
58
|
+
if (actual !== undefined) {
|
|
59
|
+
let cmd = actual[1];
|
|
60
|
+
let id = actual[0];
|
|
61
|
+
if (id === expectedId && Primitive_object.equal(cmd, expectedCmd)) {
|
|
62
|
+
return Outcome$ReventlessGwt.pass;
|
|
63
|
+
}
|
|
64
|
+
let obj = (rid, rcmd) => {
|
|
65
|
+
let d = {};
|
|
66
|
+
d["id"] = rid;
|
|
67
|
+
d["command"] = Message$ReventlessCore.encode(rcmd, Spec.commandSchema);
|
|
68
|
+
return d;
|
|
69
|
+
};
|
|
70
|
+
return Outcome$ReventlessGwt.fail({
|
|
71
|
+
TAG: "EventsMismatch",
|
|
72
|
+
expected: [obj(expectedId, expectedCmd)],
|
|
73
|
+
actual: [obj(id, cmd)]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
let obj$1 = (rid, rcmd) => {
|
|
77
|
+
let d = {};
|
|
78
|
+
d["id"] = rid;
|
|
79
|
+
d["command"] = Message$ReventlessCore.encode(rcmd, Spec.commandSchema);
|
|
80
|
+
return d;
|
|
81
|
+
};
|
|
82
|
+
return Outcome$ReventlessGwt.fail({
|
|
83
|
+
TAG: "EventsMismatch",
|
|
84
|
+
expected: [obj$1(expectedId, expectedCmd)],
|
|
85
|
+
actual: []
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
let thenNoCommand = actual => {
|
|
89
|
+
if (actual === undefined) {
|
|
90
|
+
return Outcome$ReventlessGwt.pass;
|
|
91
|
+
}
|
|
92
|
+
let d = {};
|
|
93
|
+
d["id"] = actual[0];
|
|
94
|
+
d["command"] = Message$ReventlessCore.encode(actual[1], Spec.commandSchema);
|
|
95
|
+
return Outcome$ReventlessGwt.fail({
|
|
96
|
+
TAG: "NoEventExpected",
|
|
97
|
+
actual: [d]
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
let givenEvents = es => es;
|
|
101
|
+
let whenSweep = events => {
|
|
102
|
+
let collected = events.map(e => Spec.collect(e)).flat();
|
|
103
|
+
let resolvedIds = Stdlib_Array.filterMap(events, e => Spec.resolve(e));
|
|
104
|
+
let pending = collected.filter(param => !resolvedIds.includes(param[0]));
|
|
105
|
+
let commands = Stdlib_Array.filterMap(pending, param => Spec.process(param[0], param[1]));
|
|
106
|
+
return {
|
|
107
|
+
todos: pending,
|
|
108
|
+
commands: commands
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
let thenCommands = (scenario, expected) => {
|
|
112
|
+
if (Primitive_object.equal(scenario.commands, expected)) {
|
|
113
|
+
return Outcome$ReventlessGwt.pass;
|
|
114
|
+
}
|
|
115
|
+
let toJsonPairs = arr => arr.map(param => {
|
|
116
|
+
let d = {};
|
|
117
|
+
d["id"] = param[0];
|
|
118
|
+
d["command"] = Message$ReventlessCore.encode(param[1], Spec.commandSchema);
|
|
119
|
+
return d;
|
|
120
|
+
});
|
|
121
|
+
return Outcome$ReventlessGwt.fail({
|
|
122
|
+
TAG: "EventsMismatch",
|
|
123
|
+
expected: toJsonPairs(expected),
|
|
124
|
+
actual: toJsonPairs(scenario.commands)
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
let andThenEvents = (scenario, events) => {
|
|
128
|
+
let resolvedIds = Stdlib_Array.filterMap(events, e => Spec.resolve(e));
|
|
129
|
+
let remaining = scenario.todos.filter(param => !resolvedIds.includes(param[0]));
|
|
130
|
+
return {
|
|
131
|
+
todos: remaining,
|
|
132
|
+
commands: scenario.commands
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
let thenScenarioTodos = (scenario, expected) => thenTodos(scenario.todos, expected);
|
|
136
|
+
return {
|
|
137
|
+
Spec: Spec,
|
|
138
|
+
describe: JestBind$ReventlessGwt.describe,
|
|
139
|
+
test: test,
|
|
140
|
+
givenEvent: givenEvent,
|
|
141
|
+
whenCollect: whenCollect,
|
|
142
|
+
thenTodos: thenTodos,
|
|
143
|
+
whenResolve: whenResolve,
|
|
144
|
+
thenResolved: thenResolved,
|
|
145
|
+
givenTodo: givenTodo,
|
|
146
|
+
whenProcess: whenProcess,
|
|
147
|
+
thenCommand: thenCommand,
|
|
148
|
+
thenNoCommand: thenNoCommand,
|
|
149
|
+
givenEvents: givenEvents,
|
|
150
|
+
whenSweep: whenSweep,
|
|
151
|
+
thenCommands: thenCommands,
|
|
152
|
+
andThenEvents: andThenEvents,
|
|
153
|
+
thenScenarioTodos: thenScenarioTodos
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export {
|
|
158
|
+
Make,
|
|
159
|
+
}
|
|
160
|
+
/* S Not a pure module */
|