@dereekb/util 13.11.14 → 13.11.15
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/eslint/index.cjs.js +10008 -394
- package/eslint/index.esm.js +9982 -392
- package/eslint/package.json +4 -4
- package/eslint/src/lib/comments.d.ts +14 -3
- package/eslint/src/lib/dbx-tag-families.d.ts +280 -0
- package/eslint/src/lib/index.d.ts +26 -3
- package/eslint/src/lib/jsdoc-parser.d.ts +116 -0
- package/eslint/src/lib/no-inline-string-empty-object-intersection.rule.d.ts +44 -0
- package/eslint/src/lib/no-inline-type-import.rule.d.ts +38 -0
- package/eslint/src/lib/no-sister-re-export.rule.d.ts +69 -0
- package/eslint/src/lib/plugin.d.ts +52 -1
- package/eslint/src/lib/prefer-canonical-jsdoc.rule.d.ts +68 -0
- package/eslint/src/lib/prefer-config-object.rule.d.ts +61 -0
- package/eslint/src/lib/prefer-maybe-type.rule.d.ts +72 -0
- package/eslint/src/lib/prefer-no-side-effects-in-jsdoc.rule.d.ts +1 -1
- package/eslint/src/lib/prefer-suggested-string.rule.d.ts +51 -0
- package/eslint/src/lib/require-constant-naming.rule.d.ts +63 -0
- package/eslint/src/lib/require-dbx-action-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-auth-companion-tags.rule.d.ts +45 -0
- package/eslint/src/lib/require-dbx-docs-ui-example-companion-tags.rule.d.ts +42 -0
- package/eslint/src/lib/require-dbx-filter-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-dbx-form-field-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-model-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-model-snapshot-field-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-pipe-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-dbx-rule-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-util-companion-tags.rule.d.ts +74 -0
- package/eslint/src/lib/require-dbx-web-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-default-prefix-naming.rule.d.ts +60 -0
- package/eslint/src/lib/require-deprecated-alias-placement.rule.d.ts +75 -0
- package/eslint/src/lib/require-exported-jsdoc-example.rule.d.ts +61 -0
- package/eslint/src/lib/require-no-side-effects.rule.d.ts +1 -1
- package/eslint/src/lib/require-readonly-config-params.rule.d.ts +57 -0
- package/eslint/src/lib/require-single-return.rule.d.ts +42 -0
- package/fetch/index.cjs.js +95 -80
- package/fetch/index.esm.js +95 -80
- package/fetch/package.json +2 -2
- package/fetch/src/lib/error.d.ts +2 -2
- package/fetch/src/lib/fetch.d.ts +15 -15
- package/fetch/src/lib/fetch.file.d.ts +5 -5
- package/fetch/src/lib/fetch.limit.d.ts +2 -2
- package/fetch/src/lib/fetch.page.d.ts +1 -1
- package/fetch/src/lib/fetch.page.iterate.d.ts +4 -4
- package/fetch/src/lib/fetch.type.d.ts +3 -2
- package/fetch/src/lib/fetch.url.d.ts +13 -13
- package/fetch/src/lib/json.d.ts +12 -12
- package/fetch/src/lib/timeout.d.ts +2 -2
- package/fetch/src/lib/url.d.ts +11 -11
- package/index.cjs.js +2592 -2329
- package/index.esm.js +2590 -2327
- package/package.json +1 -1
- package/src/lib/array/array.boolean.d.ts +20 -20
- package/src/lib/array/array.d.ts +73 -72
- package/src/lib/array/array.factory.d.ts +8 -5
- package/src/lib/array/array.filter.d.ts +23 -20
- package/src/lib/array/array.find.d.ts +9 -8
- package/src/lib/array/array.index.d.ts +15 -14
- package/src/lib/array/array.indexed.d.ts +22 -19
- package/src/lib/array/array.make.d.ts +3 -2
- package/src/lib/array/array.map.d.ts +5 -5
- package/src/lib/array/array.number.d.ts +27 -27
- package/src/lib/array/array.random.d.ts +11 -10
- package/src/lib/array/array.set.d.ts +14 -14
- package/src/lib/array/array.string.d.ts +31 -31
- package/src/lib/array/array.unique.d.ts +22 -20
- package/src/lib/array/array.value.d.ts +3 -2
- package/src/lib/assertion/assert.error.d.ts +8 -8
- package/src/lib/assertion/assertion.d.ts +5 -5
- package/src/lib/assertion/assertion.generic.d.ts +3 -3
- package/src/lib/assertion/assertion.number.d.ts +6 -6
- package/src/lib/auth/auth.role.claims.d.ts +12 -11
- package/src/lib/auth/auth.role.d.ts +3 -3
- package/src/lib/auth/pkce.d.ts +2 -2
- package/src/lib/boolean.d.ts +11 -11
- package/src/lib/cache/cache.memoize.d.ts +6 -6
- package/src/lib/contact/domain.d.ts +9 -9
- package/src/lib/contact/email.d.ts +11 -11
- package/src/lib/contact/phone.d.ts +12 -12
- package/src/lib/contact/random.d.ts +11 -9
- package/src/lib/date/date.d.ts +60 -59
- package/src/lib/date/date.time.d.ts +2 -2
- package/src/lib/date/date.unix.d.ts +8 -8
- package/src/lib/date/duration.d.ts +17 -17
- package/src/lib/date/expires.d.ts +29 -27
- package/src/lib/date/hour.d.ts +23 -23
- package/src/lib/date/minute.d.ts +6 -6
- package/src/lib/date/time.d.ts +10 -9
- package/src/lib/date/week.d.ts +32 -31
- package/src/lib/encryption/encryption.object.d.ts +3 -3
- package/src/lib/error/error.d.ts +13 -12
- package/src/lib/error/error.server.d.ts +4 -4
- package/src/lib/file/pdf.d.ts +4 -4
- package/src/lib/filter/filter.d.ts +3 -2
- package/src/lib/function/function.boolean.d.ts +4 -3
- package/src/lib/function/function.forward.d.ts +6 -4
- package/src/lib/getter/getter.d.ts +24 -19
- package/src/lib/getter/getter.map.d.ts +6 -5
- package/src/lib/getter/getter.util.d.ts +3 -2
- package/src/lib/grouping.d.ts +25 -24
- package/src/lib/hash.d.ts +11 -10
- package/src/lib/iterable/iterable.d.ts +39 -39
- package/src/lib/iterable/iterable.map.d.ts +3 -3
- package/src/lib/key.d.ts +16 -16
- package/src/lib/map/map.d.ts +12 -12
- package/src/lib/map/map.intersection.d.ts +3 -3
- package/src/lib/map/map.key.d.ts +16 -14
- package/src/lib/misc/host.d.ts +2 -2
- package/src/lib/model/id.batch.d.ts +4 -3
- package/src/lib/model/id.factory.d.ts +4 -3
- package/src/lib/model/model.conversion.d.ts +19 -14
- package/src/lib/model/model.conversion.field.d.ts +2 -2
- package/src/lib/model/model.copy.d.ts +5 -4
- package/src/lib/model/model.d.ts +48 -46
- package/src/lib/model/model.modify.d.ts +10 -8
- package/src/lib/nodejs/stream.d.ts +6 -5
- package/src/lib/number/bitwise.dencoder.d.ts +12 -12
- package/src/lib/number/bound.d.ts +16 -13
- package/src/lib/number/dollar.d.ts +6 -5
- package/src/lib/number/encoded.d.ts +7 -7
- package/src/lib/number/factory.d.ts +4 -3
- package/src/lib/number/number.d.ts +37 -37
- package/src/lib/number/random.d.ts +11 -10
- package/src/lib/number/round.d.ts +34 -30
- package/src/lib/number/sort.d.ts +3 -2
- package/src/lib/number/transform.d.ts +5 -4
- package/src/lib/object/object.array.d.ts +6 -6
- package/src/lib/object/object.array.delta.d.ts +3 -2
- package/src/lib/object/object.d.ts +12 -12
- package/src/lib/object/object.empty.d.ts +3 -3
- package/src/lib/object/object.equal.d.ts +11 -10
- package/src/lib/object/object.filter.pojo.d.ts +74 -74
- package/src/lib/object/object.filter.tuple.d.ts +26 -26
- package/src/lib/object/object.flatten.d.ts +4 -4
- package/src/lib/object/object.key.d.ts +6 -4
- package/src/lib/object/object.map.d.ts +15 -13
- package/src/lib/page/page.d.ts +5 -5
- package/src/lib/page/page.filter.d.ts +8 -8
- package/src/lib/path/path.d.ts +98 -88
- package/src/lib/promise/callback.d.ts +2 -2
- package/src/lib/promise/is.d.ts +6 -6
- package/src/lib/promise/poll.d.ts +9 -9
- package/src/lib/promise/promise.d.ts +33 -30
- package/src/lib/promise/promise.factory.d.ts +4 -3
- package/src/lib/promise/promise.loop.d.ts +11 -11
- package/src/lib/promise/promise.task.d.ts +6 -5
- package/src/lib/promise/promise.type.d.ts +3 -3
- package/src/lib/promise/use.d.ts +3 -3
- package/src/lib/relation/relation.d.ts +15 -15
- package/src/lib/service/handler.config.d.ts +20 -16
- package/src/lib/service/handler.d.ts +3 -2
- package/src/lib/service/typed.service.d.ts +2 -2
- package/src/lib/set/set.d.ts +62 -59
- package/src/lib/set/set.delta.d.ts +5 -4
- package/src/lib/set/set.hashset.d.ts +5 -5
- package/src/lib/set/set.selection.d.ts +5 -4
- package/src/lib/sort.d.ts +11 -11
- package/src/lib/storage/storage.d.ts +2 -1
- package/src/lib/storage/storage.error.d.ts +4 -4
- package/src/lib/storage/storage.memory.d.ts +7 -7
- package/src/lib/storage/storage.object.d.ts +5 -5
- package/src/lib/string/case.d.ts +6 -6
- package/src/lib/string/char.d.ts +30 -29
- package/src/lib/string/dencoder.d.ts +25 -20
- package/src/lib/string/factory.d.ts +11 -8
- package/src/lib/string/html.d.ts +19 -19
- package/src/lib/string/mimetype.d.ts +9 -8
- package/src/lib/string/prefix.d.ts +8 -8
- package/src/lib/string/replace.d.ts +45 -39
- package/src/lib/string/search.d.ts +5 -4
- package/src/lib/string/sort.d.ts +13 -4
- package/src/lib/string/string.d.ts +44 -43
- package/src/lib/string/transform.d.ts +32 -23
- package/src/lib/string/tree.d.ts +5 -4
- package/src/lib/string/url.d.ts +5 -4
- package/src/lib/tree/tree.array.d.ts +5 -4
- package/src/lib/tree/tree.expand.d.ts +6 -6
- package/src/lib/tree/tree.explore.d.ts +13 -10
- package/src/lib/tree/tree.flatten.d.ts +10 -10
- package/src/lib/type.d.ts +42 -12
- package/src/lib/value/address.d.ts +7 -7
- package/src/lib/value/bound.d.ts +70 -66
- package/src/lib/value/build.d.ts +6 -6
- package/src/lib/value/comparator.d.ts +19 -17
- package/src/lib/value/cron.d.ts +2 -2
- package/src/lib/value/decision.d.ts +6 -5
- package/src/lib/value/equal.d.ts +11 -9
- package/src/lib/value/indexed.d.ts +101 -85
- package/src/lib/value/label.d.ts +2 -2
- package/src/lib/value/map.d.ts +20 -16
- package/src/lib/value/maybe.d.ts +36 -36
- package/src/lib/value/modifier.d.ts +24 -23
- package/src/lib/value/point.d.ts +85 -77
- package/src/lib/value/url.d.ts +2 -2
- package/src/lib/value/use.d.ts +36 -33
- package/src/lib/value/vector.d.ts +15 -14
- package/test/index.cjs.js +41 -36
- package/test/index.esm.js +41 -36
- package/test/package.json +2 -2
- package/test/src/lib/jest/jest.fail.d.ts +2 -2
- package/test/src/lib/shared/shared.d.ts +20 -20
- package/test/src/lib/shared/shared.fail.d.ts +21 -16
- package/test/src/lib/shared/shared.function.d.ts +4 -4
- package/test/src/lib/shared/shared.wrap.d.ts +10 -10
|
@@ -12,8 +12,8 @@ export declare class ExpectedFailError extends BaseError {
|
|
|
12
12
|
/**
|
|
13
13
|
* Creates an {@link ExpectedFailError} without throwing it, for use in deferred error handling.
|
|
14
14
|
*
|
|
15
|
-
* @param message -
|
|
16
|
-
* @returns
|
|
15
|
+
* @param message - Optional error message.
|
|
16
|
+
* @returns A new {@link ExpectedFailError} instance.
|
|
17
17
|
*/
|
|
18
18
|
export declare function failSuccessfullyError(message?: string): ExpectedFailError;
|
|
19
19
|
/**
|
|
@@ -23,7 +23,8 @@ export declare function failSuccessfullyError(message?: string): ExpectedFailErr
|
|
|
23
23
|
* which catch `ExpectedFailError` and convert it into a passing test. Calling it inside a plain
|
|
24
24
|
* `it()` block causes the test to fail because the error propagates uncaught.
|
|
25
25
|
*
|
|
26
|
-
* @param message -
|
|
26
|
+
* @param message - Optional error message.
|
|
27
|
+
* @throws {ExpectedFailError} Always; never returns normally.
|
|
27
28
|
*/
|
|
28
29
|
export declare function failSuccessfully(message?: string): never;
|
|
29
30
|
/**
|
|
@@ -34,8 +35,8 @@ export declare class UnexpectedSuccessFailureError extends BaseError {
|
|
|
34
35
|
/**
|
|
35
36
|
* Creates an {@link UnexpectedSuccessFailureError} without throwing it.
|
|
36
37
|
*
|
|
37
|
-
* @param message -
|
|
38
|
-
* @returns
|
|
38
|
+
* @param message - Optional error message; defaults to a standard "expected an error" message.
|
|
39
|
+
* @returns A new {@link UnexpectedSuccessFailureError} instance.
|
|
39
40
|
*/
|
|
40
41
|
export declare function failDueToSuccessError(message?: string): UnexpectedSuccessFailureError;
|
|
41
42
|
/**
|
|
@@ -50,19 +51,23 @@ export declare class ExpectedErrorOfSpecificTypeError extends BaseError {
|
|
|
50
51
|
* Fails the current test by throwing an {@link UnexpectedSuccessFailureError}.
|
|
51
52
|
* Use when a code path should not have been reached.
|
|
52
53
|
*
|
|
53
|
-
* @param message -
|
|
54
|
+
* @param message - Optional error message.
|
|
55
|
+
* @throws {UnexpectedSuccessFailureError} Always; never returns normally.
|
|
54
56
|
*/
|
|
55
57
|
export declare function failTest(message?: string): never;
|
|
56
58
|
/**
|
|
57
59
|
* Throws an {@link UnexpectedSuccessFailureError} with a default message.
|
|
58
60
|
* Typically called when an operation succeeds but was expected to throw.
|
|
61
|
+
*
|
|
62
|
+
* @throws {UnexpectedSuccessFailureError} Always; never returns normally.
|
|
59
63
|
*/
|
|
60
64
|
export declare function failDueToSuccess(): never;
|
|
61
65
|
/**
|
|
62
66
|
* Default error handler for {@link expectSuccessfulFail} that passes through {@link ExpectedFailError}
|
|
63
67
|
* instances and re-throws all other errors.
|
|
64
68
|
*
|
|
65
|
-
* @param e -
|
|
69
|
+
* @param e - The caught error to evaluate.
|
|
70
|
+
* @throws {unknown} Re-throws the supplied error when it is not an {@link ExpectedFailError}.
|
|
66
71
|
*/
|
|
67
72
|
export declare function EXPECT_ERROR_DEFAULT_HANDLER(e: unknown): void;
|
|
68
73
|
/**
|
|
@@ -76,8 +81,8 @@ export type ExpectFailAssertionFunction = (error: unknown) => PromiseOrValue<May
|
|
|
76
81
|
*
|
|
77
82
|
* Throws an ExpectedErrorOfSpecificTypeError on failures.
|
|
78
83
|
*
|
|
79
|
-
* @param expectedType -
|
|
80
|
-
* @returns
|
|
84
|
+
* @param expectedType - The class or constructor function that the error should be an instance of.
|
|
85
|
+
* @returns An assertion function that validates the error type via instanceof.
|
|
81
86
|
*/
|
|
82
87
|
export declare function expectFailAssertErrorType(expectedType: ClassType | ClassLikeType | typeof Error | any): ExpectFailAssertionFunction;
|
|
83
88
|
/**
|
|
@@ -88,9 +93,9 @@ export declare function expectFailAssertErrorType(expectedType: ClassType | Clas
|
|
|
88
93
|
* the thrown `ExpectedFailError` propagates and fails the test even though `errorFn` rejected
|
|
89
94
|
* as expected — for that case use vitest's `await expect(...).rejects.toThrow(...)` instead.
|
|
90
95
|
*
|
|
91
|
-
* @param errorFn -
|
|
92
|
-
* @param assertFailType -
|
|
93
|
-
* @returns
|
|
96
|
+
* @param errorFn - Function expected to throw an error (sync or async)
|
|
97
|
+
* @param assertFailType - Optional assertion to validate the type or content of the thrown error.
|
|
98
|
+
* @returns Rejects with {@link ExpectedFailError} when the expected failure is verified, or with {@link UnexpectedSuccessFailureError} when `errorFn` resolves successfully.
|
|
94
99
|
*
|
|
95
100
|
* @example
|
|
96
101
|
* ```ts
|
|
@@ -123,7 +128,7 @@ export interface ShouldFailDoneCallback extends TestDoneCallback {
|
|
|
123
128
|
/**
|
|
124
129
|
* A test function for {@link shouldFail} that receives a {@link ShouldFailDoneCallback} to signal failure outcomes.
|
|
125
130
|
*/
|
|
126
|
-
export type ShouldFailProvidesCallbackWithDone = (cb: ShouldFailDoneCallback) => void
|
|
131
|
+
export type ShouldFailProvidesCallbackWithDone = (cb: ShouldFailDoneCallback) => Maybe<void>;
|
|
127
132
|
/**
|
|
128
133
|
* A test function for {@link shouldFail} that returns its result directly (sync or async), without using a done callback.
|
|
129
134
|
*/
|
|
@@ -137,8 +142,8 @@ export type ShouldFailProvidesCallback = ShouldFailProvidesCallbackWithDone | Sh
|
|
|
137
142
|
*
|
|
138
143
|
* This is typically used in conjunction with failSuccessfully(), expectSuccessfulFail(), or expectFail().
|
|
139
144
|
*
|
|
140
|
-
* @param fn -
|
|
141
|
-
* @returns
|
|
145
|
+
* @param fn - The test function that is expected to throw an {@link ExpectedFailError}
|
|
146
|
+
* @returns An async test function suitable for use with `it()`
|
|
142
147
|
*/
|
|
143
148
|
export declare function shouldFail(fn: ShouldFailProvidesCallback): () => Promise<unknown>;
|
|
144
149
|
/**
|
|
@@ -166,6 +171,6 @@ export interface FakeDoneHandler extends TestDoneCallback, PromiseReference {
|
|
|
166
171
|
* Calling the returned function with no arguments resolves the promise;
|
|
167
172
|
* calling it with an error (or calling `.fail()`) rejects the promise.
|
|
168
173
|
*
|
|
169
|
-
* @returns
|
|
174
|
+
* @returns A new {@link FakeDoneHandler} backed by a promise reference.
|
|
170
175
|
*/
|
|
171
176
|
export declare function fakeDoneHandler(): FakeDoneHandler;
|
|
@@ -20,8 +20,8 @@ export type TestFunctionFixtureBuildTests<I> = (fn: I) => void;
|
|
|
20
20
|
* The forwarded function delegates to the getter at call time, so the underlying implementation
|
|
21
21
|
* can change between tests while test declarations remain stable.
|
|
22
22
|
*
|
|
23
|
-
* @param config -
|
|
24
|
-
* @param buildTests -
|
|
23
|
+
* @param config - Provides the getter for the function under test.
|
|
24
|
+
* @param buildTests - Declares test cases using the forwarded function.
|
|
25
25
|
*/
|
|
26
26
|
export declare function useTestFunctionFixture<I extends (...args: any[]) => O, O = any>(config: UseTestFunctionFixture<I, O>, buildTests: TestFunctionFixtureBuildTests<I>): void;
|
|
27
27
|
/**
|
|
@@ -57,7 +57,7 @@ export type TestFunctionFixtureMapBuildTests<T extends UseTestFunctionMapObject>
|
|
|
57
57
|
* Similar to {@link useTestFunctionFixture} but operates on a map of functions, allowing tests
|
|
58
58
|
* to be declared against multiple related function implementations at once.
|
|
59
59
|
*
|
|
60
|
-
* @param config -
|
|
61
|
-
* @param buildTests -
|
|
60
|
+
* @param config - Provides getters for each named function under test.
|
|
61
|
+
* @param buildTests - Declares test cases using the map of forwarded functions.
|
|
62
62
|
*/
|
|
63
63
|
export declare function useTestFunctionMapFixture<T extends UseTestFunctionMapObject>(config: UseTestFunctionMapFixture<T>, buildTests: TestFunctionFixtureMapBuildTests<T>): void;
|
|
@@ -28,7 +28,7 @@ export interface WrapTestContextConfig<W, F, E = any> {
|
|
|
28
28
|
/**
|
|
29
29
|
* Wraps the fixture. This occurs once before any tests execute.
|
|
30
30
|
*/
|
|
31
|
-
wrapFixture: (fixture: F) => W;
|
|
31
|
+
readonly wrapFixture: (fixture: F) => W;
|
|
32
32
|
/**
|
|
33
33
|
* Use for doing any setup that may be required on a per-test basis.
|
|
34
34
|
*
|
|
@@ -36,38 +36,38 @@ export interface WrapTestContextConfig<W, F, E = any> {
|
|
|
36
36
|
*
|
|
37
37
|
* The setup can return an effect. This effect is passed to the teardown function later, if provided.
|
|
38
38
|
*/
|
|
39
|
-
setupWrap?: (wrap: W) => Promise<E>;
|
|
39
|
+
readonly setupWrap?: (wrap: W) => Promise<E>;
|
|
40
40
|
/**
|
|
41
41
|
* Use for cleaning up the instance before the next function.
|
|
42
42
|
*
|
|
43
43
|
* This occurs after every test, but after the fixture's instance has already been configured.
|
|
44
44
|
*/
|
|
45
|
-
teardownWrap?: (wrap: W, effect: E) => Promise<void>;
|
|
45
|
+
readonly teardownWrap?: (wrap: W, effect: E) => Promise<void>;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Wraps the input TestContextFactory to emit another type of Fixture for tests.
|
|
49
49
|
*
|
|
50
|
-
* @param config -
|
|
51
|
-
* @returns
|
|
50
|
+
* @param config - Configuration specifying how to wrap fixtures and optional setup/teardown hooks.
|
|
51
|
+
* @returns Transforms a {@link TestContextFactory} of type `F` into one of type `W`
|
|
52
52
|
*/
|
|
53
53
|
export declare function wrapTestContextFactory<W, F, E = any>(config: WrapTestContextConfig<W, F, E>): (factory: TestContextFactory<F>) => TestContextFactory<W>;
|
|
54
54
|
export interface InstanceWrapTestContextConfig<I, W extends AbstractWrappedFixtureWithInstance<I, F>, F> extends Pick<WrapTestContextConfig<W, F>, 'wrapFixture'> {
|
|
55
55
|
/**
|
|
56
56
|
* Creates a new instance for the tests.
|
|
57
57
|
*/
|
|
58
|
-
makeInstance: (wrap: W) => I | Promise<I>;
|
|
58
|
+
readonly makeInstance: (wrap: W) => I | Promise<I>;
|
|
59
59
|
/**
|
|
60
60
|
* Use for doing any setup that may be required on a per-test basis.
|
|
61
61
|
*
|
|
62
62
|
* This occurs before every test, but after the fixture's instance has already been configured.
|
|
63
63
|
*/
|
|
64
|
-
setupInstance?: (instance: I, wrap: W) => void | Promise<void>;
|
|
64
|
+
readonly setupInstance?: (instance: I, wrap: W) => void | Promise<void>;
|
|
65
65
|
/**
|
|
66
66
|
* Use for cleaning up the instance before the next function.
|
|
67
67
|
*
|
|
68
68
|
* This occurs after every test, but after the fixture's instance has already been configured.
|
|
69
69
|
*/
|
|
70
|
-
teardownInstance?: (instance: I) => void | Promise<void>;
|
|
70
|
+
readonly teardownInstance?: (instance: I) => void | Promise<void>;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Wraps a {@link TestContextFactory} to produce a fixture that manages its own instance lifecycle.
|
|
@@ -75,7 +75,7 @@ export interface InstanceWrapTestContextConfig<I, W extends AbstractWrappedFixtu
|
|
|
75
75
|
* Built on top of {@link wrapTestContextFactory}, this variant automatically creates, sets, and tears down
|
|
76
76
|
* an instance on the wrapped fixture for each test, using the provided {@link InstanceWrapTestContextConfig}.
|
|
77
77
|
*
|
|
78
|
-
* @param config -
|
|
79
|
-
* @returns
|
|
78
|
+
* @param config - Configuration for wrapping the fixture and managing instance lifecycle.
|
|
79
|
+
* @returns Transforms a {@link TestContextFactory} of type `F` into one of type `W`
|
|
80
80
|
*/
|
|
81
81
|
export declare function instanceWrapTestContextFactory<I, W extends AbstractWrappedFixtureWithInstance<I, F>, F>(config: InstanceWrapTestContextConfig<I, W, F>): (factory: TestContextFactory<F>) => TestContextFactory<W>;
|