@maligator/cli 0.1.0-alpha.27 → 0.1.0-alpha.29
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/README.md +28 -198
- package/THIRD_PARTY_NOTICES.md +6357 -0
- package/application-api.d.ts +23 -0
- package/index.d.ts +86 -16
- package/package.json +10 -6
- package/platform-api.d.ts +3 -0
- package/process-api.d.ts +28 -25
- package/test-api.d.ts +32 -0
- package/workers-api.d.ts +445 -0
- package/workers-host-api.d.ts +135 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Generated from src/platform/catalog.ts; edit the catalog and regenerate.
|
|
2
|
+
/**
|
|
3
|
+
* Runtime lifecycle notifications for supervised applications. Module evaluation and
|
|
4
|
+
* application readiness are separate events; readiness means the application has
|
|
5
|
+
* finished its own startup work.
|
|
6
|
+
*/
|
|
7
|
+
declare module "maligator:application" {
|
|
8
|
+
/**
|
|
9
|
+
* Notify the development supervisor that this application is ready. Repeated calls
|
|
10
|
+
* are harmless. Returns true in a supervised application and false in a standalone
|
|
11
|
+
* application or ordinary worker. Call after resources such as a server listener are
|
|
12
|
+
* accepting work; this does not reserve ports or transfer traffic.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* import { ready } from "maligator:application";
|
|
16
|
+
* import { createServer } from "node:http";
|
|
17
|
+
*
|
|
18
|
+
* createServer((_request, response) => response.end("hello")).listen(3000, () => ready());
|
|
19
|
+
*
|
|
20
|
+
* @see https://maligator.ddv.tools/api/application#ready
|
|
21
|
+
*/
|
|
22
|
+
export const ready: () => boolean;
|
|
23
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import "./platform-api.d.ts";
|
|
4
4
|
|
|
5
|
+
/** Service selections used when Intl is enabled; an empty list includes every service. */
|
|
5
6
|
export type MaligatorIntlFeature =
|
|
6
7
|
| "collator"
|
|
7
8
|
| "number-format"
|
|
@@ -13,56 +14,106 @@ export type MaligatorIntlFeature =
|
|
|
13
14
|
| "relative-time-format"
|
|
14
15
|
| "duration-format";
|
|
15
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Capture a regular file or a directory tree at build time. Paths are relative to
|
|
19
|
+
* the project root. Directory patterns support *, ?, and whole-segment **;
|
|
20
|
+
* every pattern must match a regular file. Symlinks are rejected.
|
|
21
|
+
* @see https://maligator.ddv.tools/api/build#AssetInclusion
|
|
22
|
+
*/
|
|
16
23
|
export type AssetInclusion =
|
|
17
24
|
| { type: "file"; path: string }
|
|
18
25
|
| { type: "directory"; path: string; include: Array<string> };
|
|
19
26
|
|
|
27
|
+
/** Trusted, strictly validated configuration evaluated for each CLI invocation.
|
|
28
|
+
* @see https://maligator.ddv.tools/guides/build-configuration
|
|
29
|
+
*/
|
|
20
30
|
export interface MaligatorBuildConfig {
|
|
31
|
+
/** Project-root-relative entry; an explicit CLI entry takes precedence. */
|
|
21
32
|
entry?: string;
|
|
33
|
+
/** Binary name; otherwise inferred from the unscoped package name or project directory. */
|
|
22
34
|
outputName?: string;
|
|
35
|
+
/** Named build-time snapshots. Requires surface.maligator; portable serialized images cannot carry these filesystem resources. */
|
|
23
36
|
assets?: Record<string, AssetInclusion>;
|
|
24
37
|
modules?: {
|
|
25
|
-
/** Exact specifier replacements applied before module resolution. */
|
|
38
|
+
/** Exact specifier replacements applied before module resolution. Defaults to an empty map. */
|
|
26
39
|
aliases?: Record<string, string>;
|
|
27
40
|
};
|
|
28
41
|
engine?: {
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* mutable is intended for conformance suites and compatibility experiments.
|
|
42
|
+
/** Lock built-in objects for the entire build. Mutable is intended for compatibility experiments.
|
|
43
|
+
* @default "locked"
|
|
32
44
|
*/
|
|
33
45
|
primordials?: "locked" | "mutable";
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
46
|
+
/** Control dynamic compilation. false leaves eval/Function present but makes calls throw;
|
|
47
|
+
* true embeds the compiler; compile-check also rejects statically visible calls at build time.
|
|
48
|
+
* @default false
|
|
49
|
+
* @see https://maligator.ddv.tools/api/build#engine.eval
|
|
38
50
|
*/
|
|
39
51
|
eval?: boolean | "compile-check";
|
|
52
|
+
/** Include Realm support.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
40
55
|
realms?: boolean;
|
|
56
|
+
/** Include RegExp; disabling it trades compatibility for binary size.
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
41
59
|
regexp?: boolean;
|
|
42
|
-
/** Include
|
|
60
|
+
/** Include Temporal and its calendar/time-zone data.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
43
63
|
temporal?: boolean;
|
|
44
64
|
intl?: {
|
|
65
|
+
/** Include internationalization services and their native data.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
45
68
|
enabled?: boolean;
|
|
69
|
+
/** Select services. An empty list includes all services when enabled.
|
|
70
|
+
* @default []
|
|
71
|
+
*/
|
|
46
72
|
features?: Array<MaligatorIntlFeature>;
|
|
73
|
+
/** Locale-data filtering is not implemented; only an empty list is accepted.
|
|
74
|
+
* @default []
|
|
75
|
+
*/
|
|
47
76
|
languages?: Array<string>;
|
|
48
77
|
};
|
|
49
78
|
};
|
|
50
79
|
surface?: {
|
|
80
|
+
/** Include Web APIs and Mal.serve. Declarations alone do not enable them.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
51
83
|
webPlatform?: boolean;
|
|
84
|
+
/** Include supported node: modules; see the compatibility table for coverage.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
52
87
|
node?: boolean;
|
|
88
|
+
/** Include the mal namespace. Required for configured assets.
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
53
91
|
maligator?: boolean;
|
|
54
92
|
};
|
|
55
93
|
}
|
|
56
94
|
|
|
95
|
+
/** Preserve the inferred config type. Validation happens when the CLI loads the config.
|
|
96
|
+
* @example
|
|
97
|
+
* import { defineBuild } from "@maligator/cli";
|
|
98
|
+
* export default defineBuild({ entry: "src/index.ts" });
|
|
99
|
+
* @see https://maligator.ddv.tools/api/build#defineBuild
|
|
100
|
+
*/
|
|
57
101
|
export declare function defineBuild<const Config extends MaligatorBuildConfig>(
|
|
58
102
|
config: Config,
|
|
59
103
|
): Config;
|
|
60
104
|
|
|
61
105
|
export interface MaligatorMaterializeOptions {
|
|
106
|
+
/** Parent directory for the content-addressed materialization. Defaults to the OS temporary directory. */
|
|
62
107
|
baseDirectory?: string;
|
|
63
108
|
}
|
|
64
109
|
|
|
65
110
|
export interface MaligatorAssets {
|
|
111
|
+
/**
|
|
112
|
+
* Atomically write a named snapshot and return its absolute file/directory path.
|
|
113
|
+
* Completed materializations are reused by content identity. Unknown names,
|
|
114
|
+
* invalid options, and filesystem failures throw synchronously.
|
|
115
|
+
* @see https://maligator.ddv.tools/api/runtime#mal.assets.materialize
|
|
116
|
+
*/
|
|
66
117
|
materialize(name: string, options?: MaligatorMaterializeOptions): string;
|
|
67
118
|
}
|
|
68
119
|
|
|
@@ -71,29 +122,48 @@ export interface MaligatorRuntime {
|
|
|
71
122
|
}
|
|
72
123
|
|
|
73
124
|
export interface MaligatorServeOptions {
|
|
125
|
+
/** Bind address. Defaults to 0.0.0.0; use 127.0.0.1 for a local-only listener. */
|
|
74
126
|
hostname?: string;
|
|
127
|
+
/** TCP port, 0 through 65535. Defaults to 0, which asks the OS to choose a port. */
|
|
75
128
|
port?: number;
|
|
129
|
+
/** Handle a request with a Response or an awaited response. */
|
|
76
130
|
fetch(request: Request): Response | PromiseLike<Response>;
|
|
131
|
+
/** Header deadline in milliseconds; 0 also selects the default. Integer 0..2147483647.
|
|
132
|
+
* @default 60000 */
|
|
133
|
+
headersTimeout?: number;
|
|
134
|
+
/** Request deadline in milliseconds; 0 also selects the default. Integer 0..2147483647.
|
|
135
|
+
* @default 300000 */
|
|
136
|
+
requestTimeout?: number;
|
|
137
|
+
/** Idle keep-alive deadline in milliseconds; 0 also selects the default. Integer 0..2147483647.
|
|
138
|
+
* @default 5000 */
|
|
139
|
+
keepAliveTimeout?: number;
|
|
140
|
+
/** Concurrent connection limit; 0 also selects the default. Integer 0..2147483647.
|
|
141
|
+
* @default 1024 */
|
|
142
|
+
maxConnections?: number;
|
|
77
143
|
}
|
|
78
144
|
|
|
79
145
|
export interface MaligatorServer {
|
|
146
|
+
/** Actual bound port, including an OS-selected port when the requested port was 0. */
|
|
80
147
|
readonly port: number;
|
|
81
148
|
}
|
|
82
149
|
|
|
83
150
|
export interface MaligatorWebRuntime {
|
|
151
|
+
/**
|
|
152
|
+
* Start an HTTP listener. Requires surface.webPlatform. The current handle exposes
|
|
153
|
+
* its bound port; it has no public stop method. Invalid timeout/connection limits throw,
|
|
154
|
+
* as does a hostname that is not ASCII or is 64 characters or longer.
|
|
155
|
+
* @see https://maligator.ddv.tools/api/runtime#Mal.serve
|
|
156
|
+
*/
|
|
84
157
|
serve(options: MaligatorServeOptions): MaligatorServer;
|
|
85
158
|
}
|
|
86
159
|
|
|
87
160
|
declare global {
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
* `surface.maligator` is enabled.
|
|
161
|
+
/** Core namespace, available when surface.maligator is enabled.
|
|
162
|
+
* @see https://maligator.ddv.tools/api/runtime#mal
|
|
91
163
|
*/
|
|
92
164
|
var mal: MaligatorRuntime;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
* Maligator's web-host extension namespace. Present when
|
|
96
|
-
* `surface.webPlatform` is enabled.
|
|
165
|
+
/** Web host namespace, available when surface.webPlatform is enabled.
|
|
166
|
+
* @see https://maligator.ddv.tools/api/runtime#Mal
|
|
97
167
|
*/
|
|
98
168
|
var Mal: MaligatorWebRuntime;
|
|
99
169
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maligator/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.29",
|
|
4
4
|
"description": "Ahead-of-time JavaScript compiler and native runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/dirkdev98/maligator#readme",
|
|
@@ -31,10 +31,14 @@
|
|
|
31
31
|
"index.js",
|
|
32
32
|
"index.d.ts",
|
|
33
33
|
"platform-api.d.ts",
|
|
34
|
+
"application-api.d.ts",
|
|
34
35
|
"process-api.d.ts",
|
|
35
36
|
"test-api.d.ts",
|
|
37
|
+
"workers-api.d.ts",
|
|
38
|
+
"workers-host-api.d.ts",
|
|
36
39
|
"README.md",
|
|
37
|
-
"LICENSE"
|
|
40
|
+
"LICENSE",
|
|
41
|
+
"THIRD_PARTY_NOTICES.md"
|
|
38
42
|
],
|
|
39
43
|
"bin": {
|
|
40
44
|
"maligator": "bin/maligator.js"
|
|
@@ -47,9 +51,9 @@
|
|
|
47
51
|
}
|
|
48
52
|
},
|
|
49
53
|
"optionalDependencies": {
|
|
50
|
-
"@maligator/cli-darwin-arm64": "0.1.0-alpha.
|
|
51
|
-
"@maligator/cli-darwin-x64": "0.1.0-alpha.
|
|
52
|
-
"@maligator/cli-linux-arm64": "0.1.0-alpha.
|
|
53
|
-
"@maligator/cli-linux-x64": "0.1.0-alpha.
|
|
54
|
+
"@maligator/cli-darwin-arm64": "0.1.0-alpha.29",
|
|
55
|
+
"@maligator/cli-darwin-x64": "0.1.0-alpha.29",
|
|
56
|
+
"@maligator/cli-linux-arm64": "0.1.0-alpha.29",
|
|
57
|
+
"@maligator/cli-linux-x64": "0.1.0-alpha.29"
|
|
54
58
|
}
|
|
55
59
|
}
|
package/platform-api.d.ts
CHANGED
package/process-api.d.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
// Generated from src/platform/catalog.ts; edit the catalog and regenerate.
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* directory, and PID are runtime concerns outside execution.
|
|
3
|
+
* Read the compile-time command, target, and resolved application configuration. No
|
|
4
|
+
* surface flag is required. Runtime arguments, environment, working directory, and
|
|
5
|
+
* PID are separate process values.
|
|
7
6
|
*/
|
|
8
7
|
declare module "maligator:process" {
|
|
9
8
|
/**
|
|
10
9
|
* Profiling instrumentation: none by default; sampling for --profile; compiler for
|
|
11
10
|
* --profile=compiler. Both profiling modes select full optimization without
|
|
12
11
|
* selecting production application behavior.
|
|
12
|
+
*
|
|
13
|
+
* @see https://maligator.ddv.tools/api/process#ExecutionProfile
|
|
13
14
|
*/
|
|
14
15
|
export type ExecutionProfile = "none" | "sampling" | "compiler";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* The fixed platform contract of the application image.
|
|
19
|
+
*
|
|
20
|
+
* @see https://maligator.ddv.tools/api/process#ExecutionTarget
|
|
18
21
|
*/
|
|
19
22
|
export type ExecutionTarget = {
|
|
20
23
|
/**
|
|
@@ -36,6 +39,8 @@ declare module "maligator:process" {
|
|
|
36
39
|
/**
|
|
37
40
|
* Options shared by build, run, and dev. Output paths, verbosity, and compiler
|
|
38
41
|
* scheduling are tool settings and are not exposed.
|
|
42
|
+
*
|
|
43
|
+
* @see https://maligator.ddv.tools/api/process#ExecutionOptions
|
|
39
44
|
*/
|
|
40
45
|
export type ExecutionOptions = {
|
|
41
46
|
/**
|
|
@@ -48,6 +53,8 @@ declare module "maligator:process" {
|
|
|
48
53
|
/**
|
|
49
54
|
* Normalized test settings, fixed for the application image. Changing these values
|
|
50
55
|
* invalidates specialized test artifacts.
|
|
56
|
+
*
|
|
57
|
+
* @see https://maligator.ddv.tools/api/process#TestExecutionOptions
|
|
51
58
|
*/
|
|
52
59
|
export type TestExecutionOptions = {
|
|
53
60
|
/**
|
|
@@ -70,8 +77,7 @@ declare module "maligator:process" {
|
|
|
70
77
|
*/
|
|
71
78
|
readonly bail: boolean;
|
|
72
79
|
/**
|
|
73
|
-
*
|
|
74
|
-
* test APIs can select a different timeout.
|
|
80
|
+
* Test callback timeout in milliseconds from --timeout. Defaults to 5000.
|
|
75
81
|
*/
|
|
76
82
|
readonly timeoutMs: number;
|
|
77
83
|
/**
|
|
@@ -85,6 +91,8 @@ declare module "maligator:process" {
|
|
|
85
91
|
/**
|
|
86
92
|
* Resolved engine policies. These describe build inputs, never post-DCE native
|
|
87
93
|
* feature inclusion.
|
|
94
|
+
*
|
|
95
|
+
* @see https://maligator.ddv.tools/api/process#ExecutionEngineConfig
|
|
88
96
|
*/
|
|
89
97
|
export type ExecutionEngineConfig = {
|
|
90
98
|
/**
|
|
@@ -133,9 +141,10 @@ declare module "maligator:process" {
|
|
|
133
141
|
};
|
|
134
142
|
|
|
135
143
|
/**
|
|
136
|
-
*
|
|
137
|
-
* build-host paths, asset declarations, output controls
|
|
138
|
-
*
|
|
144
|
+
* Resolved application engine, Web/Node surface, and module policies. Excludes
|
|
145
|
+
* build-host paths, asset declarations, and output controls.
|
|
146
|
+
*
|
|
147
|
+
* @see https://maligator.ddv.tools/api/process#ExecutionConfig
|
|
139
148
|
*/
|
|
140
149
|
export type ExecutionConfig = {
|
|
141
150
|
/**
|
|
@@ -173,6 +182,8 @@ declare module "maligator:process" {
|
|
|
173
182
|
/**
|
|
174
183
|
* Fields shared by every execution workflow. All nested objects and arrays are
|
|
175
184
|
* deeply frozen at runtime.
|
|
185
|
+
*
|
|
186
|
+
* @see https://maligator.ddv.tools/api/process#ExecutionCommon
|
|
176
187
|
*/
|
|
177
188
|
export type ExecutionCommon = {
|
|
178
189
|
/**
|
|
@@ -208,6 +219,8 @@ declare module "maligator:process" {
|
|
|
208
219
|
/**
|
|
209
220
|
* An immutable application-image description, discriminated by command. The command
|
|
210
221
|
* describes the workflow that prepared the image, not a transient process phase.
|
|
222
|
+
*
|
|
223
|
+
* @see https://maligator.ddv.tools/api/process#Execution
|
|
211
224
|
*/
|
|
212
225
|
export type Execution = ExecutionCommon &
|
|
213
226
|
(
|
|
@@ -249,16 +262,11 @@ declare module "maligator:process" {
|
|
|
249
262
|
);
|
|
250
263
|
|
|
251
264
|
/**
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* stable identity within an application context and deeply frozen own data
|
|
258
|
-
* properties; reflection sees the complete shape. Static and dynamic imports return
|
|
259
|
-
* the same export. A different command, option, configuration, target, or backend
|
|
260
|
-
* creates a different compilation context. Profiling does not change production
|
|
261
|
-
* intent. Importing the module does not keep unused native code alive.
|
|
265
|
+
* An immutable snapshot of the workflow, target, and resolved configuration, fixed
|
|
266
|
+
* before compilation. Known property reads can specialize application branches.
|
|
267
|
+
* Runtime arguments, environment, working directory, and PID are outside this
|
|
268
|
+
* snapshot. Profiling does not change production intent. Static and dynamic imports
|
|
269
|
+
* share its identity, and reflection sees the complete deeply frozen shape.
|
|
262
270
|
*
|
|
263
271
|
* @example
|
|
264
272
|
* import { execution } from "maligator:process";
|
|
@@ -267,12 +275,7 @@ declare module "maligator:process" {
|
|
|
267
275
|
* console.log("native production application");
|
|
268
276
|
* }
|
|
269
277
|
*
|
|
270
|
-
* @
|
|
271
|
-
* import { execution } from "maligator:process";
|
|
272
|
-
*
|
|
273
|
-
* if (execution.command === "test") {
|
|
274
|
-
* console.log(execution.options.repeat);
|
|
275
|
-
* }
|
|
278
|
+
* @see https://maligator.ddv.tools/api/process#execution
|
|
276
279
|
*/
|
|
277
280
|
export const execution: Execution;
|
|
278
281
|
}
|
package/test-api.d.ts
CHANGED
|
@@ -9,16 +9,22 @@ declare module "maligator:test" {
|
|
|
9
9
|
/**
|
|
10
10
|
* A test or hook body. Maligator waits for a returned promise or thenable before
|
|
11
11
|
* advancing the lifecycle.
|
|
12
|
+
*
|
|
13
|
+
* @see https://maligator.ddv.tools/api/test#TestCallback
|
|
12
14
|
*/
|
|
13
15
|
export type TestCallback = () => unknown;
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* A lifecycle hook body, with the same async completion contract as a test.
|
|
19
|
+
*
|
|
20
|
+
* @see https://maligator.ddv.tools/api/test#HookCallback
|
|
17
21
|
*/
|
|
18
22
|
export type HookCallback = TestCallback;
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* A constructable value accepted by {@link expect.any}.
|
|
26
|
+
*
|
|
27
|
+
* @see https://maligator.ddv.tools/api/test#Constructor
|
|
22
28
|
*/
|
|
23
29
|
export type Constructor = abstract new (...args: Array<never>) => unknown;
|
|
24
30
|
|
|
@@ -26,6 +32,8 @@ declare module "maligator:test" {
|
|
|
26
32
|
* Opaque partial-match value produced by helpers such as {@link
|
|
27
33
|
* expect.objectContaining}. It may be nested inside `toEqual`, `toStrictEqual`, and
|
|
28
34
|
* `toMatchObject` expectations.
|
|
35
|
+
*
|
|
36
|
+
* @see https://maligator.ddv.tools/api/test#AsymmetricMatcher
|
|
29
37
|
*/
|
|
30
38
|
export type AsymmetricMatcher = {
|
|
31
39
|
readonly __maligator_asymmetric__: string;
|
|
@@ -33,6 +41,8 @@ declare module "maligator:test" {
|
|
|
33
41
|
|
|
34
42
|
/**
|
|
35
43
|
* Matchers for a synchronously received value.
|
|
44
|
+
*
|
|
45
|
+
* @see https://maligator.ddv.tools/api/test#Matchers
|
|
36
46
|
*/
|
|
37
47
|
export type Matchers = {
|
|
38
48
|
/** Negate the following matcher. */
|
|
@@ -86,6 +96,8 @@ declare module "maligator:test" {
|
|
|
86
96
|
* Promise-returning matcher surface exposed by {@link Matchers.resolves} and {@link
|
|
87
97
|
* Matchers.rejects}. Await these calls so the test cannot finish before the
|
|
88
98
|
* assertion.
|
|
99
|
+
*
|
|
100
|
+
* @see https://maligator.ddv.tools/api/test#AsyncMatchers
|
|
89
101
|
*/
|
|
90
102
|
export type AsyncMatchers = {
|
|
91
103
|
/** Negate the following asynchronous matcher. */
|
|
@@ -113,6 +125,8 @@ declare module "maligator:test" {
|
|
|
113
125
|
|
|
114
126
|
/**
|
|
115
127
|
* Assertion entrypoint and Maligator-owned asymmetric matcher factories.
|
|
128
|
+
*
|
|
129
|
+
* @see https://maligator.ddv.tools/api/test#ExpectFunction
|
|
116
130
|
*/
|
|
117
131
|
export type ExpectFunction = {
|
|
118
132
|
/** Create matchers for `received`. The assertion position is captured here. */
|
|
@@ -131,6 +145,8 @@ declare module "maligator:test" {
|
|
|
131
145
|
|
|
132
146
|
/**
|
|
133
147
|
* Register tests in the current suite during module evaluation.
|
|
148
|
+
*
|
|
149
|
+
* @see https://maligator.ddv.tools/api/test#TestFunction
|
|
134
150
|
*/
|
|
135
151
|
export type TestFunction = {
|
|
136
152
|
/** Register a test. Returned promises are awaited by the runner. */
|
|
@@ -155,6 +171,8 @@ declare module "maligator:test" {
|
|
|
155
171
|
|
|
156
172
|
/**
|
|
157
173
|
* Register nested suites synchronously during module evaluation.
|
|
174
|
+
*
|
|
175
|
+
* @see https://maligator.ddv.tools/api/test#DescribeFunction
|
|
158
176
|
*/
|
|
159
177
|
export type DescribeFunction = {
|
|
160
178
|
/** Register a suite. Suite callbacks must not return a promise. */
|
|
@@ -167,32 +185,46 @@ declare module "maligator:test" {
|
|
|
167
185
|
|
|
168
186
|
/**
|
|
169
187
|
* Register a test in the current suite.
|
|
188
|
+
*
|
|
189
|
+
* @see https://maligator.ddv.tools/api/test#test
|
|
170
190
|
*/
|
|
171
191
|
export const test: TestFunction;
|
|
172
192
|
/**
|
|
173
193
|
* Register a nested suite in the current suite.
|
|
194
|
+
*
|
|
195
|
+
* @see https://maligator.ddv.tools/api/test#describe
|
|
174
196
|
*/
|
|
175
197
|
export const describe: DescribeFunction;
|
|
176
198
|
/**
|
|
177
199
|
* Create fluent matchers for a received value.
|
|
200
|
+
*
|
|
201
|
+
* @see https://maligator.ddv.tools/api/test#expect
|
|
178
202
|
*/
|
|
179
203
|
export const expect: ExpectFunction;
|
|
180
204
|
/**
|
|
181
205
|
* Run once before tests in the current suite.
|
|
206
|
+
*
|
|
207
|
+
* @see https://maligator.ddv.tools/api/test#beforeAll
|
|
182
208
|
*/
|
|
183
209
|
export const beforeAll: (callback: HookCallback) => void;
|
|
184
210
|
/**
|
|
185
211
|
* Run once after tests in the current suite, including after test failures.
|
|
212
|
+
*
|
|
213
|
+
* @see https://maligator.ddv.tools/api/test#afterAll
|
|
186
214
|
*/
|
|
187
215
|
export const afterAll: (callback: HookCallback) => void;
|
|
188
216
|
/**
|
|
189
217
|
* Run before every selected descendant test. Ancestor hooks run before hooks
|
|
190
218
|
* declared by a nested suite.
|
|
219
|
+
*
|
|
220
|
+
* @see https://maligator.ddv.tools/api/test#beforeEach
|
|
191
221
|
*/
|
|
192
222
|
export const beforeEach: (callback: HookCallback) => void;
|
|
193
223
|
/**
|
|
194
224
|
* Run after every selected descendant test. Nested-suite hooks run before ancestor
|
|
195
225
|
* hooks.
|
|
226
|
+
*
|
|
227
|
+
* @see https://maligator.ddv.tools/api/test#afterEach
|
|
196
228
|
*/
|
|
197
229
|
export const afterEach: (callback: HookCallback) => void;
|
|
198
230
|
}
|