@iterativeflow/conformance 2.0.0-alpha.2 → 2.0.0-alpha.4
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/dist/index.mjs +21 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -925,6 +925,27 @@ const timerConformance = (label, makeTimer) => {
|
|
|
925
925
|
limit: 2
|
|
926
926
|
})).toEqual(["early", "mid"]);
|
|
927
927
|
});
|
|
928
|
+
it("nextDueAt is null when nothing is pending", async () => {
|
|
929
|
+
expect(await (await makeTimer()).nextDueAt(at(0))).toBeNull();
|
|
930
|
+
});
|
|
931
|
+
it("nextDueAt returns the earliest timer due strictly after now", async () => {
|
|
932
|
+
const tm = await makeTimer();
|
|
933
|
+
await tm.schedule("late", at(3e3));
|
|
934
|
+
await tm.schedule("early", at(1e3));
|
|
935
|
+
await tm.schedule("mid", at(2e3));
|
|
936
|
+
expect(await tm.nextDueAt(at(500))).toEqual(at(1e3));
|
|
937
|
+
expect(await tm.nextDueAt(at(1e3))).toEqual(at(2e3));
|
|
938
|
+
expect(await tm.nextDueAt(at(3e3))).toBeNull();
|
|
939
|
+
});
|
|
940
|
+
it("nextDueAt reflects reschedule and cancel", async () => {
|
|
941
|
+
const tm = await makeTimer();
|
|
942
|
+
await tm.schedule("r1", at(5e3));
|
|
943
|
+
expect(await tm.nextDueAt(at(0))).toEqual(at(5e3));
|
|
944
|
+
await tm.schedule("r1", at(1e3));
|
|
945
|
+
expect(await tm.nextDueAt(at(0))).toEqual(at(1e3));
|
|
946
|
+
await tm.cancel("r1");
|
|
947
|
+
expect(await tm.nextDueAt(at(0))).toBeNull();
|
|
948
|
+
});
|
|
928
949
|
});
|
|
929
950
|
};
|
|
930
951
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iterativeflow/conformance",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"build": "tsdown"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@iterativeflow/core": "2.0.0-alpha.
|
|
31
|
+
"@iterativeflow/core": "2.0.0-alpha.4"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"vitest": ">=3"
|