@everyonesoftware/common 11.0.0 → 13.0.0

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.
@@ -1,4 +1,4 @@
1
- import { f as JavascriptIterable, S as SyncResult, P as PromiseAsyncResult, k as Type, I as Iterable, A as AsyncResult, C as CharacterWriteStream } from './characterWriteStream-Bhad6oGq.cjs';
1
+ import { g as JavascriptIterable, S as SyncResult, P as PromiseAsyncResult, l as Type, I as Iterable, A as AsyncResult, C as CharacterWriteStream, a as Clock, D as DateTime } from './characterWriteStream-DGlmRcFl.cjs';
2
2
 
3
3
  /**
4
4
  * A type that can be used to make assertions during a test.
@@ -526,4 +526,19 @@ declare class ConsoleTestRunner implements TestRunner {
526
526
  printSummary(): AsyncResult<void>;
527
527
  }
528
528
 
529
- export { AssertTest, BasicTestSkip, type ConsoleTestFunction, type ConsoleTestFunctionContainer, ConsoleTestRunner, FailedTest, SkippedTest, Test, TestAction, type TestActionType, TestRunner, TestSkip, test };
529
+ /**
530
+ * A {@link Clock} implementation that returns a configured {@link DateTime}.
531
+ */
532
+ declare class FakeClock extends Clock {
533
+ private currentTime;
534
+ private constructor();
535
+ static create(currentTime?: DateTime): FakeClock;
536
+ /**
537
+ * Set the {@link DateTime} that this {@link FakeClock} will return.
538
+ * @param currentTime The {@link DateTime} that this {@link FakeClock} will return.
539
+ */
540
+ setCurrentTime(currentTime: DateTime): this;
541
+ now(): DateTime;
542
+ }
543
+
544
+ export { AssertTest, BasicTestSkip, type ConsoleTestFunction, type ConsoleTestFunctionContainer, ConsoleTestRunner, FailedTest, FakeClock, SkippedTest, Test, TestAction, type TestActionType, TestRunner, TestSkip, test };
@@ -1,4 +1,4 @@
1
- import { f as JavascriptIterable, S as SyncResult, P as PromiseAsyncResult, k as Type, I as Iterable, A as AsyncResult, C as CharacterWriteStream } from './characterWriteStream-Bhad6oGq.js';
1
+ import { g as JavascriptIterable, S as SyncResult, P as PromiseAsyncResult, l as Type, I as Iterable, A as AsyncResult, C as CharacterWriteStream, a as Clock, D as DateTime } from './characterWriteStream-DGlmRcFl.js';
2
2
 
3
3
  /**
4
4
  * A type that can be used to make assertions during a test.
@@ -526,4 +526,19 @@ declare class ConsoleTestRunner implements TestRunner {
526
526
  printSummary(): AsyncResult<void>;
527
527
  }
528
528
 
529
- export { AssertTest, BasicTestSkip, type ConsoleTestFunction, type ConsoleTestFunctionContainer, ConsoleTestRunner, FailedTest, SkippedTest, Test, TestAction, type TestActionType, TestRunner, TestSkip, test };
529
+ /**
530
+ * A {@link Clock} implementation that returns a configured {@link DateTime}.
531
+ */
532
+ declare class FakeClock extends Clock {
533
+ private currentTime;
534
+ private constructor();
535
+ static create(currentTime?: DateTime): FakeClock;
536
+ /**
537
+ * Set the {@link DateTime} that this {@link FakeClock} will return.
538
+ * @param currentTime The {@link DateTime} that this {@link FakeClock} will return.
539
+ */
540
+ setCurrentTime(currentTime: DateTime): this;
541
+ now(): DateTime;
542
+ }
543
+
544
+ export { AssertTest, BasicTestSkip, type ConsoleTestFunction, type ConsoleTestFunctionContainer, ConsoleTestRunner, FailedTest, FakeClock, SkippedTest, Test, TestAction, type TestActionType, TestRunner, TestSkip, test };
@@ -9,13 +9,42 @@ import {
9
9
  TestRunner,
10
10
  TestSkip,
11
11
  test
12
- } from "./chunk-R3D7NRFL.js";
13
- import "./chunk-U7O7WS5F.js";
12
+ } from "./chunk-P4KLLRFY.js";
13
+ import {
14
+ Clock,
15
+ DateTime,
16
+ PreCondition
17
+ } from "./chunk-TUBXFCG4.js";
18
+
19
+ // tests/FakeClock.ts
20
+ var FakeClock = class _FakeClock extends Clock {
21
+ currentTime;
22
+ constructor(currentTime) {
23
+ PreCondition.assertNotUndefinedAndNotNull(currentTime, "currentTime");
24
+ super();
25
+ this.currentTime = currentTime;
26
+ }
27
+ static create(currentTime) {
28
+ return new _FakeClock(currentTime ?? DateTime.now());
29
+ }
30
+ /**
31
+ * Set the {@link DateTime} that this {@link FakeClock} will return.
32
+ * @param currentTime The {@link DateTime} that this {@link FakeClock} will return.
33
+ */
34
+ setCurrentTime(currentTime) {
35
+ this.currentTime = currentTime;
36
+ return this;
37
+ }
38
+ now() {
39
+ return this.currentTime;
40
+ }
41
+ };
14
42
  export {
15
43
  AssertTest,
16
44
  BasicTestSkip,
17
45
  ConsoleTestRunner,
18
46
  FailedTest,
47
+ FakeClock,
19
48
  SkippedTest,
20
49
  Test,
21
50
  TestAction,
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../tests/FakeClock.ts"],"sourcesContent":["import { Clock, DateTime, PreCondition } from \"../sources\";\n\n/**\n * A {@link Clock} implementation that returns a configured {@link DateTime}.\n */\nexport class FakeClock extends Clock\n{\n private currentTime: DateTime;\n\n private constructor(currentTime: DateTime)\n {\n PreCondition.assertNotUndefinedAndNotNull(currentTime, \"currentTime\");\n\n super();\n\n this.currentTime = currentTime;\n }\n\n public static create(currentTime?: DateTime): FakeClock\n {\n return new FakeClock(currentTime ?? DateTime.now());\n }\n\n /**\n * Set the {@link DateTime} that this {@link FakeClock} will return.\n * @param currentTime The {@link DateTime} that this {@link FakeClock} will return.\n */\n public setCurrentTime(currentTime: DateTime): this\n {\n this.currentTime = currentTime;\n\n return this;\n }\n\n public now(): DateTime\n {\n return this.currentTime;\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;AAKO,IAAM,YAAN,MAAM,mBAAkB,MAC/B;AAAA,EACY;AAAA,EAEA,YAAY,aACpB;AACI,iBAAa,6BAA6B,aAAa,aAAa;AAEpE,UAAM;AAEN,SAAK,cAAc;AAAA,EACvB;AAAA,EAEA,OAAc,OAAO,aACrB;AACI,WAAO,IAAI,WAAU,eAAe,SAAS,IAAI,CAAC;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,eAAe,aACtB;AACI,SAAK,cAAc;AAEnB,WAAO;AAAA,EACX;AAAA,EAEO,MACP;AACI,WAAO,KAAK;AAAA,EAChB;AACJ;","names":[]}