@alchemy.run/test 0.0.0 → 2.0.0-beta.85
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/LICENSE +201 -0
- package/bin/alchemy-test.ts +2 -0
- package/lib/Alchemy.d.ts +78 -0
- package/lib/Alchemy.d.ts.map +1 -0
- package/lib/Alchemy.js +194 -0
- package/lib/Alchemy.js.map +1 -0
- package/lib/Api.d.ts +134 -0
- package/lib/Api.d.ts.map +1 -0
- package/lib/Api.js +245 -0
- package/lib/Api.js.map +1 -0
- package/lib/Bun.d.ts +67 -0
- package/lib/Bun.d.ts.map +1 -0
- package/lib/Bun.js +143 -0
- package/lib/Bun.js.map +1 -0
- package/lib/Capture.d.ts +10 -0
- package/lib/Capture.d.ts.map +1 -0
- package/lib/Capture.js +68 -0
- package/lib/Capture.js.map +1 -0
- package/lib/Core.d.ts +287 -0
- package/lib/Core.d.ts.map +1 -0
- package/lib/Core.js +429 -0
- package/lib/Core.js.map +1 -0
- package/lib/DevCli.d.ts +47 -0
- package/lib/DevCli.d.ts.map +1 -0
- package/lib/DevCli.js +181 -0
- package/lib/DevCli.js.map +1 -0
- package/lib/Expect.d.ts +84 -0
- package/lib/Expect.d.ts.map +1 -0
- package/lib/Expect.js +518 -0
- package/lib/Expect.js.map +1 -0
- package/lib/FileLog.d.ts +27 -0
- package/lib/FileLog.d.ts.map +1 -0
- package/lib/FileLog.js +136 -0
- package/lib/FileLog.js.map +1 -0
- package/lib/Http.d.ts +109 -0
- package/lib/Http.d.ts.map +1 -0
- package/lib/Http.js +123 -0
- package/lib/Http.js.map +1 -0
- package/lib/Model.d.ts +98 -0
- package/lib/Model.d.ts.map +1 -0
- package/lib/Model.js +59 -0
- package/lib/Model.js.map +1 -0
- package/lib/PlainReporter.d.ts +19 -0
- package/lib/PlainReporter.d.ts.map +1 -0
- package/lib/PlainReporter.js +348 -0
- package/lib/PlainReporter.js.map +1 -0
- package/lib/Plan.d.ts +19 -0
- package/lib/Plan.d.ts.map +1 -0
- package/lib/Plan.js +32 -0
- package/lib/Plan.js.map +1 -0
- package/lib/Registry.d.ts +34 -0
- package/lib/Registry.d.ts.map +1 -0
- package/lib/Registry.js +80 -0
- package/lib/Registry.js.map +1 -0
- package/lib/Reporter.d.ts +160 -0
- package/lib/Reporter.d.ts.map +1 -0
- package/lib/Reporter.js +9 -0
- package/lib/Reporter.js.map +1 -0
- package/lib/Runner.d.ts +51 -0
- package/lib/Runner.d.ts.map +1 -0
- package/lib/Runner.js +1052 -0
- package/lib/Runner.js.map +1 -0
- package/lib/StrayOutput.d.ts +8 -0
- package/lib/StrayOutput.d.ts.map +1 -0
- package/lib/StrayOutput.js +259 -0
- package/lib/StrayOutput.js.map +1 -0
- package/lib/Tags.d.ts +17 -0
- package/lib/Tags.d.ts.map +1 -0
- package/lib/Tags.js +84 -0
- package/lib/Tags.js.map +1 -0
- package/lib/TestState.d.ts +12 -0
- package/lib/TestState.d.ts.map +1 -0
- package/lib/TestState.js +15 -0
- package/lib/TestState.js.map +1 -0
- package/lib/Tui.d.ts +4 -0
- package/lib/Tui.d.ts.map +1 -0
- package/lib/Tui.js +1137 -0
- package/lib/Tui.js.map +1 -0
- package/lib/Vitest.d.ts +58 -0
- package/lib/Vitest.d.ts.map +1 -0
- package/lib/Vitest.js +132 -0
- package/lib/Vitest.js.map +1 -0
- package/lib/WorktreeStage.d.ts +17 -0
- package/lib/WorktreeStage.d.ts.map +1 -0
- package/lib/WorktreeStage.js +48 -0
- package/lib/WorktreeStage.js.map +1 -0
- package/lib/cli.d.ts +2 -0
- package/lib/cli.d.ts.map +1 -0
- package/lib/cli.js +222 -0
- package/lib/cli.js.map +1 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -0
- package/lib/index.js.map +1 -0
- package/package.json +73 -3
- package/src/Alchemy.ts +335 -0
- package/src/Api.ts +521 -0
- package/src/Bun.ts +256 -0
- package/src/Capture.ts +72 -0
- package/src/Core.ts +872 -0
- package/src/DevCli.ts +229 -0
- package/src/Expect.ts +763 -0
- package/src/FileLog.ts +158 -0
- package/src/Http.ts +201 -0
- package/src/Model.ts +160 -0
- package/src/PlainReporter.ts +426 -0
- package/src/Plan.ts +45 -0
- package/src/Registry.ts +101 -0
- package/src/Reporter.ts +171 -0
- package/src/Runner.ts +1341 -0
- package/src/StrayOutput.ts +283 -0
- package/src/Tags.ts +100 -0
- package/src/TestState.ts +35 -0
- package/src/Tui.ts +1272 -0
- package/src/Vitest.ts +239 -0
- package/src/WorktreeStage.ts +45 -0
- package/src/cli.ts +330 -0
- package/src/index.ts +57 -0
- package/README.md +0 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/lib/Alchemy.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** @effect-diagnostics anyUnknownInErrorContext:off */
|
|
2
|
+
import type { StackDefinition } from "alchemy/Stack";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Core from "./Core.ts";
|
|
5
|
+
/**
|
|
6
|
+
* Test adapter for the `alchemy-test` runner (see `packages/alchemy-test`).
|
|
7
|
+
*
|
|
8
|
+
* Same shape as {@link "./Vitest.ts"} / {@link "./Bun.ts"}, but registers
|
|
9
|
+
* tests as raw Effects with the alchemy-test harness so the single-process
|
|
10
|
+
* runner can inject a buffering Logger/Console per test and manage
|
|
11
|
+
* concurrency + timeouts itself.
|
|
12
|
+
*/
|
|
13
|
+
import { type TestOptions } from "./index.ts";
|
|
14
|
+
export { executeWhenReady, getWhenReady, guardContentType, guardedFetchLayer, rpcClientLayer, WorkerNotReady, type EdgeGuardOptions, type WhenReadyOptions, } from "./Http.ts";
|
|
15
|
+
export type MakeOptions<ROut = any> = Core.MakeOptions<ROut>;
|
|
16
|
+
export type ScratchStack = Core.ScratchStack;
|
|
17
|
+
export type TestEffect<A, R = never> = Core.TestEffect<A, R>;
|
|
18
|
+
export declare const ALCHEMY_TEST_DEV: import("effect/Config").Config<import("effect/Option").Option<boolean>>;
|
|
19
|
+
export declare const resolveDev: typeof Core.resolveDev;
|
|
20
|
+
export declare const defaultStage: typeof Core.defaultStage;
|
|
21
|
+
export declare const resolveStage: typeof Core.resolveStage;
|
|
22
|
+
export declare const captureResourceLog: typeof Core.captureResourceLog;
|
|
23
|
+
interface TestFn {
|
|
24
|
+
(name: string, eff: TestEffect<void>, options?: TestOptions): void;
|
|
25
|
+
skip: (name: string, eff: TestEffect<void>, options?: TestOptions) => void;
|
|
26
|
+
skipIf: (condition: boolean) => (name: string, eff: TestEffect<void>, options?: TestOptions) => void;
|
|
27
|
+
only: (name: string, eff: TestEffect<void>, options?: TestOptions) => void;
|
|
28
|
+
todo: (name: string, eff: TestEffect<void>, options?: TestOptions) => void;
|
|
29
|
+
provider: ProviderFn;
|
|
30
|
+
}
|
|
31
|
+
interface ProviderFn {
|
|
32
|
+
(name: string, fn: (stack: ScratchStack) => Effect.Effect<void, any, any>, options?: TestOptions): void;
|
|
33
|
+
skip: (name: string, fn: (stack: ScratchStack) => Effect.Effect<void, any, any>, options?: TestOptions) => void;
|
|
34
|
+
skipIf: (condition: boolean) => (name: string, fn: (stack: ScratchStack) => Effect.Effect<void, any, any>, options?: TestOptions) => void;
|
|
35
|
+
todo: (name: string, fn: (stack: ScratchStack) => Effect.Effect<void, any, any>, options?: TestOptions) => void;
|
|
36
|
+
}
|
|
37
|
+
interface BeforeAllFn {
|
|
38
|
+
<A>(eff: TestEffect<A>, options?: TestOptions): Effect.Effect<A>;
|
|
39
|
+
}
|
|
40
|
+
interface BeforeEachFn {
|
|
41
|
+
(eff: TestEffect<void>, options?: TestOptions): void;
|
|
42
|
+
}
|
|
43
|
+
interface AfterAllFn {
|
|
44
|
+
(eff: TestEffect<any>, options?: TestOptions): void;
|
|
45
|
+
skipIf: (predicate: boolean) => (eff: TestEffect<any>, options?: TestOptions) => void;
|
|
46
|
+
}
|
|
47
|
+
interface AfterEachFn {
|
|
48
|
+
(eff: TestEffect<void>, options?: TestOptions): void;
|
|
49
|
+
}
|
|
50
|
+
export interface TestApi {
|
|
51
|
+
test: TestFn;
|
|
52
|
+
beforeAll: BeforeAllFn;
|
|
53
|
+
beforeEach: BeforeEachFn;
|
|
54
|
+
afterAll: AfterAllFn;
|
|
55
|
+
afterEach: AfterEachFn;
|
|
56
|
+
deploy: Core.Deploy;
|
|
57
|
+
destroy: <ROut>(stack: StackDefinition<ROut>, options?: {
|
|
58
|
+
stage?: string;
|
|
59
|
+
include?: never;
|
|
60
|
+
exclude?: never;
|
|
61
|
+
}) => ReturnType<typeof Core.destroy>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Build the per-file test API. Configure providers / state once at the top of
|
|
65
|
+
* the test file:
|
|
66
|
+
*
|
|
67
|
+
* ```ts
|
|
68
|
+
* import * as Test from "@alchemy.run/test/Alchemy";
|
|
69
|
+
* import * as Cloudflare from "@alchemy.run/cloudflare";
|
|
70
|
+
*
|
|
71
|
+
* const { test, deploy, destroy, beforeAll, afterAll } = Test.make({
|
|
72
|
+
* providers: Cloudflare.providers(),
|
|
73
|
+
* state: Cloudflare.state(),
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare const make: <ROut = any>(options: MakeOptions<ROut>) => TestApi;
|
|
78
|
+
//# sourceMappingURL=Alchemy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alchemy.d.ts","sourceRoot":"","sources":["../src/Alchemy.ts"],"names":[],"mappings":"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}
|
package/lib/Alchemy.js
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/** @effect-diagnostics anyUnknownInErrorContext:off */
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Exit from "effect/Exit";
|
|
4
|
+
import * as Scope from "effect/Scope";
|
|
5
|
+
import * as Semaphore from "effect/Semaphore";
|
|
6
|
+
import * as Core from "./Core.js";
|
|
7
|
+
/**
|
|
8
|
+
* Test adapter for the `alchemy-test` runner (see `packages/alchemy-test`).
|
|
9
|
+
*
|
|
10
|
+
* Same shape as {@link "./Vitest.ts"} / {@link "./Bun.ts"}, but registers
|
|
11
|
+
* tests as raw Effects with the alchemy-test harness so the single-process
|
|
12
|
+
* runner can inject a buffering Logger/Console per test and manage
|
|
13
|
+
* concurrency + timeouts itself.
|
|
14
|
+
*/
|
|
15
|
+
import { currentFile, exclusiveOf, registerFileCleanup, registerHook, registerTest, retryOf, tagsOf, optInTagsOf, timeoutOf, } from "./index.js";
|
|
16
|
+
export { executeWhenReady, getWhenReady, guardContentType, guardedFetchLayer, rpcClientLayer, WorkerNotReady, } from "./Http.js";
|
|
17
|
+
export const ALCHEMY_TEST_DEV = Core.ALCHEMY_TEST_DEV;
|
|
18
|
+
export const resolveDev = Core.resolveDev;
|
|
19
|
+
export const defaultStage = Core.defaultStage;
|
|
20
|
+
export const resolveStage = Core.resolveStage;
|
|
21
|
+
export const captureResourceLog = Core.captureResourceLog;
|
|
22
|
+
const DEFAULT_TIMEOUT = 120_000;
|
|
23
|
+
/**
|
|
24
|
+
* Build the per-file test API. Configure providers / state once at the top of
|
|
25
|
+
* the test file:
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* import * as Test from "@alchemy.run/test/Alchemy";
|
|
29
|
+
* import * as Cloudflare from "@alchemy.run/cloudflare";
|
|
30
|
+
*
|
|
31
|
+
* const { test, deploy, destroy, beforeAll, afterAll } = Test.make({
|
|
32
|
+
* providers: Cloudflare.providers(),
|
|
33
|
+
* state: Cloudflare.state(),
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const make = (options) => {
|
|
38
|
+
// Single scope shared across `beforeAll`, every `test`, and `afterAll`.
|
|
39
|
+
// Scoped resources in dev mode (the Cloudflare dev proxy and its workerd
|
|
40
|
+
// children) must outlive a single test boundary, otherwise the proxy is
|
|
41
|
+
// killed the moment `beforeAll(deploy(Stack))` resolves and every later
|
|
42
|
+
// `HttpClient.get(workerUrl)` hits a dead port. The scope is closed by
|
|
43
|
+
// `destroy(...)` (or by file cleanup below).
|
|
44
|
+
let sharedScope = Scope.makeUnsafe("sequential");
|
|
45
|
+
// Session ownership outlives a mid-file destroy, but not file cleanup.
|
|
46
|
+
let sidecar = Core.makeSidecarHandle(options);
|
|
47
|
+
const clearResults = new Set();
|
|
48
|
+
const wrap = (eff) => sharedScope === undefined
|
|
49
|
+
? Effect.die("Test runtime is closed")
|
|
50
|
+
: Core.toEffect(eff, options, sharedScope, sidecar);
|
|
51
|
+
const addTest = (name, eff, opts, mode) => registerTest({
|
|
52
|
+
name,
|
|
53
|
+
mode,
|
|
54
|
+
exclusive: exclusiveOf(opts),
|
|
55
|
+
retry: retryOf(opts),
|
|
56
|
+
timeout: timeoutOf(opts),
|
|
57
|
+
tags: tagsOf(opts),
|
|
58
|
+
optInTags: optInTagsOf(opts),
|
|
59
|
+
body: mode === "skip" || mode === "todo" ? undefined : () => wrap(eff),
|
|
60
|
+
});
|
|
61
|
+
const test = ((name, eff, opts) => {
|
|
62
|
+
addTest(name, eff, opts, "run");
|
|
63
|
+
});
|
|
64
|
+
test.skip = (name, eff, opts) => addTest(name, eff, opts, "skip");
|
|
65
|
+
test.skipIf = (condition) => (name, eff, opts) => addTest(name, eff, opts, condition ? "skip" : "run");
|
|
66
|
+
test.only = (name, eff, opts) => addTest(name, eff, opts, "only");
|
|
67
|
+
test.todo = (name, eff, opts) => addTest(name, eff, opts, "todo");
|
|
68
|
+
// One lock per scratch stack. When an attempt times out, the runner fires
|
|
69
|
+
// an interrupt and ABANDONS the attempt's fiber after a short grace — but
|
|
70
|
+
// the fiber keeps running its teardown (`scratch.destroy()` below) in the
|
|
71
|
+
// background, e.g. a CloudFront disable-wait. Without this lock the retry
|
|
72
|
+
// starts concurrently on the SAME scratch state: the stale teardown then
|
|
73
|
+
// deletes the state rows the retry just wrote for the same logical ids,
|
|
74
|
+
// orphaning the retry's cloud resources (observed: two leaked CloudFront
|
|
75
|
+
// distributions + buckets + OACs from one retried test). Holding the lock
|
|
76
|
+
// across body + teardown makes a retry wait (on its own timeout clock)
|
|
77
|
+
// until the previous attempt's teardown has fully settled.
|
|
78
|
+
const scratchLocks = new Map();
|
|
79
|
+
const scratchLock = (name) => {
|
|
80
|
+
let lock = scratchLocks.get(name);
|
|
81
|
+
if (lock === undefined) {
|
|
82
|
+
lock = Semaphore.makeUnsafe(1);
|
|
83
|
+
scratchLocks.set(name, lock);
|
|
84
|
+
}
|
|
85
|
+
return lock;
|
|
86
|
+
};
|
|
87
|
+
const wrapProvider = (name, fn, file) => {
|
|
88
|
+
if (sharedScope === undefined)
|
|
89
|
+
return Effect.die("Test runtime is closed");
|
|
90
|
+
// Durable, file-namespaced scratch state (`.alchemy/state`). A run that
|
|
91
|
+
// dies mid-delete — e.g. the runner abandons teardown 10s after a test
|
|
92
|
+
// timeout while a CloudFront disable-wait is still in flight — leaves
|
|
93
|
+
// its `deleting` rows on disk, so the NEXT run's leading
|
|
94
|
+
// `stack.destroy()` (or the ensuring teardown below) resumes and drains
|
|
95
|
+
// them instead of planning "no changes" and silently orphaning the
|
|
96
|
+
// cloud resource.
|
|
97
|
+
const scratch = Core.scratchStack(options, name, file);
|
|
98
|
+
// Guarantee teardown. `test.provider` has no built-in cleanup, so a body
|
|
99
|
+
// that fails (assertion, API error like a 409/Unauthorized) or is
|
|
100
|
+
// interrupted (timeout) BEFORE its trailing `stack.destroy()` would
|
|
101
|
+
// otherwise leak every cloud resource it deployed.
|
|
102
|
+
// `scratch.destroy()` is idempotent — a no-op when the body already
|
|
103
|
+
// destroyed, and it reclaims the orphans otherwise. `Effect.ensuring`
|
|
104
|
+
// runs the finalizer on success, failure, AND interruption.
|
|
105
|
+
const body = Core.withProviders(fn(scratch), options, scratch.name).pipe(Effect.ensuring(scratch.destroy().pipe(Effect.ignore)), scratchLock(scratch.name).withPermits(1));
|
|
106
|
+
return Core.toEffect(body, { ...options, state: scratch.state }, sharedScope, sidecar);
|
|
107
|
+
};
|
|
108
|
+
const addProvider = (name, fn, opts, mode) => {
|
|
109
|
+
// Captured at registration (module evaluation during collection) — the
|
|
110
|
+
// collection context is gone by the time the body runs.
|
|
111
|
+
const file = currentFile();
|
|
112
|
+
registerTest({
|
|
113
|
+
name,
|
|
114
|
+
mode,
|
|
115
|
+
exclusive: exclusiveOf(opts),
|
|
116
|
+
retry: retryOf(opts),
|
|
117
|
+
timeout: timeoutOf(opts),
|
|
118
|
+
tags: tagsOf(opts),
|
|
119
|
+
optInTags: optInTagsOf(opts),
|
|
120
|
+
body: mode === "run" ? () => wrapProvider(name, fn, file) : undefined,
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
const provider = ((name, fn, opts) => {
|
|
124
|
+
addProvider(name, fn, opts, "run");
|
|
125
|
+
});
|
|
126
|
+
provider.skip = (name, fn, opts) => addProvider(name, fn, opts, "skip");
|
|
127
|
+
provider.skipIf = (condition) => (name, fn, opts) => addProvider(name, fn, opts, condition ? "skip" : "run");
|
|
128
|
+
provider.todo = (name, fn, opts) => addProvider(name, fn, opts, "todo");
|
|
129
|
+
test.provider = provider;
|
|
130
|
+
const beforeAll = (eff, hookOptions) => {
|
|
131
|
+
let result;
|
|
132
|
+
clearResults.add(() => {
|
|
133
|
+
result = undefined;
|
|
134
|
+
});
|
|
135
|
+
registerHook("beforeAll", {
|
|
136
|
+
body: () => wrap(eff).pipe(Effect.map((value) => {
|
|
137
|
+
if (sharedScope !== undefined)
|
|
138
|
+
result = value;
|
|
139
|
+
})),
|
|
140
|
+
timeout: timeoutOf(hookOptions) ?? DEFAULT_TIMEOUT,
|
|
141
|
+
exclusive: exclusiveOf(hookOptions),
|
|
142
|
+
});
|
|
143
|
+
return Effect.sync(() => result);
|
|
144
|
+
};
|
|
145
|
+
const beforeEach = (eff, hookOptions) => {
|
|
146
|
+
registerHook("beforeEach", { body: () => wrap(eff), timeout: timeoutOf(hookOptions) });
|
|
147
|
+
};
|
|
148
|
+
const afterAll = ((eff, hookOptions) => {
|
|
149
|
+
registerHook("afterAll", {
|
|
150
|
+
body: () => wrap(eff),
|
|
151
|
+
timeout: timeoutOf(hookOptions) ?? DEFAULT_TIMEOUT,
|
|
152
|
+
exclusive: exclusiveOf(hookOptions),
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
afterAll.skipIf = (predicate) => (eff, hookOptions) => {
|
|
156
|
+
if (predicate)
|
|
157
|
+
return;
|
|
158
|
+
registerHook("afterAll", {
|
|
159
|
+
body: () => wrap(eff),
|
|
160
|
+
timeout: timeoutOf(hookOptions) ?? DEFAULT_TIMEOUT,
|
|
161
|
+
exclusive: exclusiveOf(hookOptions),
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
const afterEach = (eff, hookOptions) => {
|
|
165
|
+
registerHook("afterEach", { body: () => wrap(eff), timeout: timeoutOf(hookOptions) });
|
|
166
|
+
};
|
|
167
|
+
// `destroy(Stack)` needs the dev sidecar alive so it can call `sidecar.stop`
|
|
168
|
+
// for each worker. We close the shared scope only AFTER destroy completes.
|
|
169
|
+
// `Scope.close` on an already-closed scope is a no-op, so it's safe for both
|
|
170
|
+
// the destroy wrapper AND the fallback cleanup hook below to call it.
|
|
171
|
+
const closeScope = Effect.suspend(() => sharedScope === undefined ? Effect.void : Scope.close(sharedScope, Exit.void)).pipe(Effect.ignore);
|
|
172
|
+
// File cleanup runs after user afterAll, including skipped/failed imports.
|
|
173
|
+
// Interactive retries retain the runtime until the runner releases the file.
|
|
174
|
+
registerFileCleanup({
|
|
175
|
+
body: () => closeScope.pipe(Effect.ensuring(Effect.suspend(() => sidecar?.close ?? Effect.void)), Effect.ensuring(Effect.sync(() => {
|
|
176
|
+
sharedScope = undefined;
|
|
177
|
+
sidecar = undefined;
|
|
178
|
+
for (const clear of clearResults)
|
|
179
|
+
clear();
|
|
180
|
+
clearResults.clear();
|
|
181
|
+
}))),
|
|
182
|
+
timeout: DEFAULT_TIMEOUT,
|
|
183
|
+
});
|
|
184
|
+
return {
|
|
185
|
+
test,
|
|
186
|
+
beforeAll,
|
|
187
|
+
beforeEach,
|
|
188
|
+
afterAll,
|
|
189
|
+
afterEach,
|
|
190
|
+
deploy: Core.makeDeploy(options, sharedScope),
|
|
191
|
+
destroy: (stack, callOpts) => Core.destroy(options, stack, { ...callOpts, scope: sharedScope }).pipe(Effect.ensuring(closeScope)),
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
//# sourceMappingURL=Alchemy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alchemy.js","sourceRoot":"","sources":["../src/Alchemy.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAKvD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC;;;;;;;GAOG;AACH,OAAO,EACL,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,WAAW,EACX,SAAS,GAEV,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,cAAc,GAGf,MAAM,WAAW,CAAC;AAKnB,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,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CACb,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;YACf,WAAW,GAAG,SAAS,CAAC;YACxB,OAAO,GAAG,SAAS,CAAC;YACpB,KAAK,MAAM,KAAK,IAAI,YAAY;gBAAE,KAAK,EAAE,CAAC;YAC1C,YAAY,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC,CAAC,CACH,CACF;QACH,OAAO,EAAE,eAAe;KACzB,CAAC,CAAC;IAEH,OAAO;QACL,IAAI;QACJ,SAAS;QACT,UAAU;QACV,QAAQ;QACR,SAAS;QACT,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC;QAC7C,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAC3B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,IAAI,CACpE,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAC5B;KACJ,CAAC;AACJ,CAAC,CAAC"}
|
package/lib/Api.d.ts
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vitest-compatible registration API: `describe`, `it`/`test`, hooks and
|
|
3
|
+
* `layer`. Registration builds the {@link Model} tree; execution is the
|
|
4
|
+
* runner's job. Everything is Effect-first — plain-function tests are wrapped
|
|
5
|
+
* into Effects at registration time.
|
|
6
|
+
*/
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as Layer from "effect/Layer";
|
|
9
|
+
import * as Scope from "effect/Scope";
|
|
10
|
+
import * as TestClock from "effect/testing/TestClock";
|
|
11
|
+
import * as TestConsole from "effect/testing/TestConsole";
|
|
12
|
+
import type { Exclusive, Hook, Mode, TestBody } from "./Model.ts";
|
|
13
|
+
import { type Tags } from "./Tags.ts";
|
|
14
|
+
export type TestOptions = number | {
|
|
15
|
+
/** Labels added to the tags inherited from enclosing suites. */
|
|
16
|
+
readonly tags?: Tags;
|
|
17
|
+
/** Tags that must each be explicitly named in the filter to enable this test or suite. */
|
|
18
|
+
readonly optInTags?: Tags;
|
|
19
|
+
readonly timeout?: number;
|
|
20
|
+
readonly retry?: number;
|
|
21
|
+
readonly repeats?: number;
|
|
22
|
+
/**
|
|
23
|
+
* `true` runs this test with the whole-process write lock — no other
|
|
24
|
+
* test in the run executes concurrently with it. Use for tests that
|
|
25
|
+
* mutate process-global state (e.g. `process.env.PATH`): the runner
|
|
26
|
+
* executes everything in ONE bun process, so such mutations are
|
|
27
|
+
* visible to every other running test.
|
|
28
|
+
*
|
|
29
|
+
* A label (e.g. `"hetzner"`) only serializes the test with others
|
|
30
|
+
* holding the same label, so unrelated tests keep running. Use it for
|
|
31
|
+
* a shared cloud quota.
|
|
32
|
+
*/
|
|
33
|
+
readonly exclusive?: Exclusive;
|
|
34
|
+
};
|
|
35
|
+
export declare const timeoutOf: (options?: TestOptions) => number | undefined;
|
|
36
|
+
export declare const retryOf: (options?: TestOptions) => number | undefined;
|
|
37
|
+
export declare const exclusiveOf: (options?: TestOptions) => Exclusive;
|
|
38
|
+
export declare const tagsOf: (options?: TestOptions) => Tags | undefined;
|
|
39
|
+
export declare const optInTagsOf: (options?: TestOptions) => Tags | undefined;
|
|
40
|
+
type DescribeBody = (() => void) | undefined;
|
|
41
|
+
export interface DescribeOptions {
|
|
42
|
+
/** Labels inherited by every nested suite and test. */
|
|
43
|
+
readonly tags?: Tags;
|
|
44
|
+
/** Tags that must each be explicitly named in the filter to enable this test or suite. */
|
|
45
|
+
readonly optInTags?: Tags;
|
|
46
|
+
readonly concurrent?: boolean;
|
|
47
|
+
readonly sequential?: boolean;
|
|
48
|
+
readonly timeout?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface DescribeFn {
|
|
51
|
+
(name: string | (() => void), body?: DescribeBody | DescribeOptions | number, bodyOrTimeout?: DescribeBody | number): void;
|
|
52
|
+
readonly sequential: DescribeFn;
|
|
53
|
+
readonly concurrent: DescribeFn;
|
|
54
|
+
readonly skip: DescribeFn;
|
|
55
|
+
readonly only: DescribeFn;
|
|
56
|
+
readonly todo: DescribeFn;
|
|
57
|
+
skipIf(condition: unknown): DescribeFn;
|
|
58
|
+
runIf(condition: unknown): DescribeFn;
|
|
59
|
+
each<T>(cases: ReadonlyArray<T>): (name: string, fn: (args: T) => void, options?: TestOptions) => void;
|
|
60
|
+
}
|
|
61
|
+
export declare const describe: DescribeFn;
|
|
62
|
+
export interface RegisterTestOptions {
|
|
63
|
+
readonly tags?: Tags;
|
|
64
|
+
/** Tags that must each be explicitly named in the filter to enable this test or suite. */
|
|
65
|
+
readonly optInTags?: Tags;
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly mode: Mode;
|
|
68
|
+
readonly fails?: boolean;
|
|
69
|
+
readonly exclusive?: Exclusive;
|
|
70
|
+
readonly retry?: number | undefined;
|
|
71
|
+
readonly timeout?: number | undefined;
|
|
72
|
+
readonly body: TestBody | undefined;
|
|
73
|
+
}
|
|
74
|
+
/** Low-level test registration — used by adapters (e.g. alchemy Test.make). */
|
|
75
|
+
export declare const registerTest: (options: RegisterTestOptions) => void;
|
|
76
|
+
/** Minimal stand-in for vitest's TestContext (rarely used by our tests). */
|
|
77
|
+
export interface TestContext {
|
|
78
|
+
readonly signal?: AbortSignal;
|
|
79
|
+
}
|
|
80
|
+
export type EffectTestFunction<R> = (ctx: TestContext) => Effect.Effect<unknown, unknown, R>;
|
|
81
|
+
export interface Tester<R> {
|
|
82
|
+
(name: string, self: EffectTestFunction<R>, options?: TestOptions): void;
|
|
83
|
+
skip(name: string, self: EffectTestFunction<R>, options?: TestOptions): void;
|
|
84
|
+
skipIf(condition: unknown): (name: string, self: EffectTestFunction<R>, options?: TestOptions) => void;
|
|
85
|
+
runIf(condition: unknown): (name: string, self: EffectTestFunction<R>, options?: TestOptions) => void;
|
|
86
|
+
only(name: string, self: EffectTestFunction<R>, options?: TestOptions): void;
|
|
87
|
+
fails(name: string, self: EffectTestFunction<R>, options?: TestOptions): void;
|
|
88
|
+
each<T>(cases: ReadonlyArray<T>): (name: string, self: (args: T) => Effect.Effect<unknown, unknown, R>, options?: TestOptions) => void;
|
|
89
|
+
}
|
|
90
|
+
export declare const makeTester: <R>(mapEffect: (self: Effect.Effect<unknown, unknown, R>) => Effect.Effect<unknown, unknown, never>) => Tester<R>;
|
|
91
|
+
export interface TestFn {
|
|
92
|
+
(name: string, fn?: (ctx: TestContext) => unknown, options?: TestOptions): void;
|
|
93
|
+
skip(name: string, fn?: (ctx: TestContext) => unknown, options?: TestOptions): void;
|
|
94
|
+
only(name: string, fn?: (ctx: TestContext) => unknown, options?: TestOptions): void;
|
|
95
|
+
todo(name: string, fn?: (ctx: TestContext) => unknown, options?: TestOptions): void;
|
|
96
|
+
fails(name: string, fn?: (ctx: TestContext) => unknown, options?: TestOptions): void;
|
|
97
|
+
skipIf(condition: unknown): (name: string, fn?: (ctx: TestContext) => unknown, options?: TestOptions) => void;
|
|
98
|
+
runIf(condition: unknown): (name: string, fn?: (ctx: TestContext) => unknown, options?: TestOptions) => void;
|
|
99
|
+
each<T>(cases: ReadonlyArray<T>): (name: string, fn: (args: T) => unknown, options?: TestOptions) => void;
|
|
100
|
+
/** Effect tester with TestClock + TestConsole (matches @effect/vitest). */
|
|
101
|
+
readonly effect: Tester<Scope.Scope | TestClock.TestClock | TestConsole.TestConsole>;
|
|
102
|
+
/** Effect tester against the live environment (scope only). */
|
|
103
|
+
readonly live: Tester<Scope.Scope>;
|
|
104
|
+
}
|
|
105
|
+
export declare const it: TestFn;
|
|
106
|
+
export declare const test: TestFn;
|
|
107
|
+
export type HookKind = "beforeAll" | "afterAll" | "beforeEach" | "afterEach";
|
|
108
|
+
/** Framework cleanup after user teardown, including files with no runnable tests. */
|
|
109
|
+
export declare const registerFileCleanup: (hook: Hook) => void;
|
|
110
|
+
/** Low-level hook registration with an Effect body — used by adapters. */
|
|
111
|
+
export declare const registerHook: (kind: HookKind, hook: Hook) => void;
|
|
112
|
+
export declare const beforeAll: (fn: () => unknown, timeout?: number) => void;
|
|
113
|
+
export declare const afterAll: (fn: () => unknown, timeout?: number) => void;
|
|
114
|
+
export declare const beforeEach: (fn: () => unknown, timeout?: number) => void;
|
|
115
|
+
export declare const afterEach: (fn: () => unknown, timeout?: number) => void;
|
|
116
|
+
export interface LayerMethods<R> {
|
|
117
|
+
effect: Tester<R | Scope.Scope | TestClock.TestClock | TestConsole.TestConsole>;
|
|
118
|
+
layer<R2, E2>(nested: Layer.Layer<R2, E2, R>, options?: {
|
|
119
|
+
readonly timeout?: number;
|
|
120
|
+
}): {
|
|
121
|
+
(f: (it: LayerMethods<R | R2>) => void): void;
|
|
122
|
+
(name: string, f: (it: LayerMethods<R | R2>) => void): void;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export declare const layer: <R, E>(layer_: Layer.Layer<R, E>, options?: {
|
|
126
|
+
readonly memoMap?: Layer.MemoMap;
|
|
127
|
+
readonly timeout?: number;
|
|
128
|
+
readonly excludeTestServices?: boolean;
|
|
129
|
+
}) => {
|
|
130
|
+
(f: (it: LayerMethods<R>) => void): void;
|
|
131
|
+
(name: string, f: (it: LayerMethods<R>) => void): void;
|
|
132
|
+
};
|
|
133
|
+
export {};
|
|
134
|
+
//# sourceMappingURL=Api.d.ts.map
|
package/lib/Api.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Api.d.ts","sourceRoot":"","sources":["../src/Api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,WAAW,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QA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