@overkill-dev/test 0.0.12 → 0.0.14
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/package.json +18 -12
- package/packages/test/authoring-input.js +34 -0
- package/packages/test/authoring-input.js.map +1 -0
- package/packages/test/authoring-source-locations.js +71 -0
- package/packages/test/authoring-source-locations.js.map +1 -0
- package/packages/test/authoring-test-data.d.ts +58 -0
- package/packages/test/authoring-test-data.d.ts.map +1 -0
- package/packages/test/authoring-test-data.js +194 -0
- package/packages/test/authoring-test-data.js.map +1 -0
- package/packages/test/command-line-runner.js +39 -4
- package/packages/test/command-line-runner.js.map +1 -1
- package/packages/test/compatibility.entry-point.d.ts +4 -0
- package/packages/test/compatibility.entry-point.d.ts.map +1 -0
- package/packages/test/compatibility.entry-point.js +2 -0
- package/packages/test/compatibility.entry-point.js.map +1 -0
- package/packages/test/config.entry-point.d.ts +1 -1
- package/packages/test/config.entry-point.d.ts.map +1 -1
- package/packages/test/harness-authoring.d.ts +18 -0
- package/packages/test/harness-authoring.d.ts.map +1 -0
- package/packages/test/harness-authoring.js +25 -0
- package/packages/test/harness-authoring.js.map +1 -0
- package/packages/test/interaction-transcript.d.ts +39 -0
- package/packages/test/interaction-transcript.d.ts.map +1 -0
- package/packages/test/interaction-transcript.js +302 -0
- package/packages/test/interaction-transcript.js.map +1 -0
- package/packages/test/reporters.entry-point.d.ts +1 -0
- package/packages/test/reporters.entry-point.d.ts.map +1 -1
- package/packages/test/resource-wrapper-composition.js +313 -0
- package/packages/test/resource-wrapper-composition.js.map +1 -0
- package/packages/test/resource-wrapper-data.d.ts +39 -0
- package/packages/test/resource-wrapper-data.d.ts.map +1 -0
- package/packages/test/resource-wrapper-data.js +101 -0
- package/packages/test/resource-wrapper-data.js.map +1 -0
- package/packages/test/resource-wrapper-runtime-scope.js +44 -0
- package/packages/test/resource-wrapper-runtime-scope.js.map +1 -0
- package/packages/test/resource-wrapper-session.js +3 -0
- package/packages/test/resource-wrapper-session.js.map +1 -0
- package/packages/test/resources.entry-point.d.ts +20 -1
- package/packages/test/resources.entry-point.d.ts.map +1 -1
- package/packages/test/resources.entry-point.js +46 -2
- package/packages/test/resources.entry-point.js.map +1 -1
- package/packages/test/table-authoring.d.ts +19 -0
- package/packages/test/table-authoring.d.ts.map +1 -0
- package/packages/test/table-authoring.js +77 -0
- package/packages/test/table-authoring.js.map +1 -0
- package/packages/test/test-authoring.d.ts +68 -0
- package/packages/test/test-authoring.d.ts.map +1 -0
- package/packages/test/test-authoring.js +212 -0
- package/packages/test/test-authoring.js.map +1 -0
- package/packages/test/test.entry-point.d.ts +10 -35
- package/packages/test/test.entry-point.d.ts.map +1 -1
- package/packages/test/test.entry-point.js +3 -250
- package/packages/test/test.entry-point.js.map +1 -1
- package/packages/test/throwing-test-authoring.d.ts +15 -0
- package/packages/test/throwing-test-authoring.d.ts.map +1 -0
- package/packages/test/throwing-test-authoring.js +47 -0
- package/packages/test/throwing-test-authoring.js.map +1 -0
- package/readme.md +372 -12
- package/sbom.cdx.json +61 -44
|
@@ -1,252 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { createTestFacade, defineMacro, defineParameterizedTestBody, runIfMain, skippedTest, suite, table, test } from "./test-authoring.js";
|
|
2
|
+
export { defineHarness } from "./harness-authoring.js";
|
|
3
|
+
export { createTranscript, recordAsyncSink, recordSink, transcriptUsage } from "./interaction-transcript.js";
|
|
2
4
|
export { doubleUsage, rule, testAsyncDisposable, testAsyncIterable, testAsyncIterator, testDisposable, testDouble, testIterable, testIterator } from "@overkill-dev/doubles";
|
|
3
|
-
const singleArgumentCount = 1;
|
|
4
|
-
const positionalArgumentCount = 2;
|
|
5
|
-
const testArgumentsError = 'test() requires (title, body) or ({ title, metadata, body }).';
|
|
6
|
-
const suiteArgumentsError = 'suite() requires (title, children) or ({ title, metadata, children }).';
|
|
7
|
-
const tableArgumentsError = 'table() requires ({ title, cases, metadata?, caseTitle?, test }).';
|
|
8
|
-
const activeMacroDefinitionLocations = [];
|
|
9
|
-
function createUnavailableAuthoringApi(name) {
|
|
10
|
-
return function unavailableAuthoringApi() {
|
|
11
|
-
throw new Error(`The @overkill-dev/test ${name}() authoring API is not implemented yet.`);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function isRecord(value) {
|
|
15
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
16
|
-
}
|
|
17
|
-
function assertMetadataObject(value) {
|
|
18
|
-
if (!isRecord(value)) {
|
|
19
|
-
throw new TypeError('Test node metadata must be an object.');
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function readRecord(value, message) {
|
|
23
|
-
if (!isRecord(value)) {
|
|
24
|
-
throw new TypeError(message);
|
|
25
|
-
}
|
|
26
|
-
return value;
|
|
27
|
-
}
|
|
28
|
-
function readTitle(value, message) {
|
|
29
|
-
if (typeof value !== 'string') {
|
|
30
|
-
throw new TypeError(message);
|
|
31
|
-
}
|
|
32
|
-
return value;
|
|
33
|
-
}
|
|
34
|
-
function isTestBody(value) {
|
|
35
|
-
return typeof value === 'function';
|
|
36
|
-
}
|
|
37
|
-
function readBody(value) {
|
|
38
|
-
if (!isTestBody(value)) {
|
|
39
|
-
throw new TypeError('Test case body must be a function.');
|
|
40
|
-
}
|
|
41
|
-
return value;
|
|
42
|
-
}
|
|
43
|
-
function createMicrotestMetadata(value) {
|
|
44
|
-
const metadata = isRecord(value) && !Object.hasOwn(value, 'kind')
|
|
45
|
-
? { ...value, kind: 'microtest' }
|
|
46
|
-
: value;
|
|
47
|
-
assertMetadataObject(metadata);
|
|
48
|
-
return metadata;
|
|
49
|
-
}
|
|
50
|
-
function readChildren(value, message) {
|
|
51
|
-
if (!Array.isArray(value)) {
|
|
52
|
-
throw new TypeError(message);
|
|
53
|
-
}
|
|
54
|
-
const children = [];
|
|
55
|
-
for (const child of value) {
|
|
56
|
-
children.push(child);
|
|
57
|
-
}
|
|
58
|
-
return children;
|
|
59
|
-
}
|
|
60
|
-
function readTestDefinition(value) {
|
|
61
|
-
const definition = readRecord(value, testArgumentsError);
|
|
62
|
-
return {
|
|
63
|
-
body: readBody(definition.body),
|
|
64
|
-
metadata: createMicrotestMetadata(definition.metadata),
|
|
65
|
-
title: readTitle(definition.title, testArgumentsError)
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
function readSuiteDefinition(value) {
|
|
69
|
-
const definition = readRecord(value, suiteArgumentsError);
|
|
70
|
-
return {
|
|
71
|
-
children: readChildren(definition.children, suiteArgumentsError),
|
|
72
|
-
metadata: createMicrotestMetadata(definition.metadata),
|
|
73
|
-
title: readTitle(definition.title, suiteArgumentsError)
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function defaultCaseTitle(index) {
|
|
77
|
-
return `case ${index + 1}`;
|
|
78
|
-
}
|
|
79
|
-
function captureAuthoringLocation() {
|
|
80
|
-
return captureSourceLocation()();
|
|
81
|
-
}
|
|
82
|
-
function currentMacroDefinitionLocations() {
|
|
83
|
-
return activeMacroDefinitionLocations.at(-1) ?? [];
|
|
84
|
-
}
|
|
85
|
-
function sourceLocationsWithTrailingLocation(sourceLocations, location) {
|
|
86
|
-
const firstLocation = sourceLocations[0];
|
|
87
|
-
return firstLocation === undefined
|
|
88
|
-
? [location]
|
|
89
|
-
: [firstLocation, ...sourceLocations.slice(1), location];
|
|
90
|
-
}
|
|
91
|
-
function definitionLocationsForAuthoringCall() {
|
|
92
|
-
return sourceLocationsWithTrailingLocation(currentMacroDefinitionLocations(), captureAuthoringLocation());
|
|
93
|
-
}
|
|
94
|
-
function runWithForwardedSourceLocations(sourceLocations, body) {
|
|
95
|
-
const firstLocation = sourceLocations[0];
|
|
96
|
-
return firstLocation === undefined
|
|
97
|
-
? body()
|
|
98
|
-
: forwardAssertionSourceLocations([firstLocation, ...sourceLocations.slice(1)], body);
|
|
99
|
-
}
|
|
100
|
-
function assertionBodyForActiveMacro(body) {
|
|
101
|
-
const sourceLocations = currentMacroDefinitionLocations();
|
|
102
|
-
if (sourceLocations.length === 0) {
|
|
103
|
-
return body;
|
|
104
|
-
}
|
|
105
|
-
return async function runMacroGeneratedTestBody(scope) {
|
|
106
|
-
return await runWithForwardedSourceLocations(sourceLocations, async function runBody() {
|
|
107
|
-
return await body(scope);
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function tableCaseTitle(caseTitle, parameters, index) {
|
|
112
|
-
const title = caseTitle === null ? defaultCaseTitle(index) : caseTitle(parameters, index);
|
|
113
|
-
if (typeof title !== 'string') {
|
|
114
|
-
throw new TypeError('table() caseTitle must return a string.');
|
|
115
|
-
}
|
|
116
|
-
return title;
|
|
117
|
-
}
|
|
118
|
-
function tableCaseBody(definition, parameters, sourceLocations) {
|
|
119
|
-
return async function runTableCase(scope) {
|
|
120
|
-
return await runWithForwardedSourceLocations(sourceLocations, async function runMacroGeneratedTableCase() {
|
|
121
|
-
return await definition.test({ ...scope, parameters });
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function ensureTableDefinitionShape(definition) {
|
|
126
|
-
if (definition.caseTitle !== undefined && typeof definition.caseTitle !== 'function') {
|
|
127
|
-
throw new TypeError(tableArgumentsError);
|
|
128
|
-
}
|
|
129
|
-
if (!Array.isArray(definition.cases)) {
|
|
130
|
-
throw new TypeError(tableArgumentsError);
|
|
131
|
-
}
|
|
132
|
-
if (!isTestBody(definition.test)) {
|
|
133
|
-
throw new TypeError('Test case body must be a function.');
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function readTableDefinition(definition) {
|
|
137
|
-
const runtimeDefinition = readRecord(definition, tableArgumentsError);
|
|
138
|
-
ensureTableDefinitionShape(runtimeDefinition);
|
|
139
|
-
return {
|
|
140
|
-
caseTitle: definition.caseTitle ?? null,
|
|
141
|
-
cases: definition.cases,
|
|
142
|
-
metadata: createMicrotestMetadata(runtimeDefinition.metadata ?? {}),
|
|
143
|
-
test: definition.test,
|
|
144
|
-
title: readTitle(runtimeDefinition.title, tableArgumentsError)
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function tableCases(definition) {
|
|
148
|
-
const sourceLocations = currentMacroDefinitionLocations();
|
|
149
|
-
return definition.cases.map(function createTableCase(parameters, index) {
|
|
150
|
-
return {
|
|
151
|
-
body: tableCaseBody(definition, parameters, sourceLocations),
|
|
152
|
-
metadata: {},
|
|
153
|
-
parameters,
|
|
154
|
-
title: tableCaseTitle(definition.caseTitle, parameters, index)
|
|
155
|
-
};
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
export function test(...input) {
|
|
159
|
-
if (input.length === singleArgumentCount) {
|
|
160
|
-
const definition = readTestDefinition(input[0]);
|
|
161
|
-
return createTestCase({
|
|
162
|
-
body: assertionBodyForActiveMacro(definition.body),
|
|
163
|
-
definitionLocations: definitionLocationsForAuthoringCall(),
|
|
164
|
-
metadata: definition.metadata,
|
|
165
|
-
title: definition.title
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
if (input.length === positionalArgumentCount) {
|
|
169
|
-
const [name, body] = input;
|
|
170
|
-
return createTestCase({
|
|
171
|
-
body: assertionBodyForActiveMacro(readBody(body)),
|
|
172
|
-
definitionLocations: definitionLocationsForAuthoringCall(),
|
|
173
|
-
metadata: createMicrotestMetadata({}),
|
|
174
|
-
title: readTitle(name, testArgumentsError)
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
throw new TypeError(testArgumentsError);
|
|
178
|
-
}
|
|
179
|
-
export function suite(...input) {
|
|
180
|
-
if (input.length === singleArgumentCount) {
|
|
181
|
-
const definition = readSuiteDefinition(input[0]);
|
|
182
|
-
return createSuite({
|
|
183
|
-
children: definition.children,
|
|
184
|
-
definitionLocations: definitionLocationsForAuthoringCall(),
|
|
185
|
-
metadata: definition.metadata,
|
|
186
|
-
title: definition.title
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
if (input.length === positionalArgumentCount) {
|
|
190
|
-
const [name, children] = input;
|
|
191
|
-
return createSuite({
|
|
192
|
-
children: readChildren(children, suiteArgumentsError),
|
|
193
|
-
definitionLocations: definitionLocationsForAuthoringCall(),
|
|
194
|
-
metadata: createMicrotestMetadata({}),
|
|
195
|
-
title: readTitle(name, suiteArgumentsError)
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
throw new TypeError(suiteArgumentsError);
|
|
199
|
-
}
|
|
200
|
-
export function table(definition) {
|
|
201
|
-
const tableDefinition = readTableDefinition(definition);
|
|
202
|
-
return createTable({
|
|
203
|
-
cases: tableCases(tableDefinition),
|
|
204
|
-
definitionLocations: definitionLocationsForAuthoringCall(),
|
|
205
|
-
metadata: tableDefinition.metadata,
|
|
206
|
-
title: tableDefinition.title
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
export const createTestFacade = createUnavailableAuthoringApi('createTestFacade');
|
|
210
|
-
function createMacroNode(factory, parameters) {
|
|
211
|
-
const node = factory(...parameters);
|
|
212
|
-
if (!ownsTestNode(node)) {
|
|
213
|
-
throw new TypeError('defineMacro() factory must return a default-engine TestNode value.');
|
|
214
|
-
}
|
|
215
|
-
return node;
|
|
216
|
-
}
|
|
217
|
-
export function defineMacro(factory) {
|
|
218
|
-
if (typeof factory !== 'function') {
|
|
219
|
-
throw new TypeError('defineMacro() requires a factory function.');
|
|
220
|
-
}
|
|
221
|
-
return function runMacro(...parameters) {
|
|
222
|
-
const definitionLocations = definitionLocationsForAuthoringCall();
|
|
223
|
-
activeMacroDefinitionLocations.push(definitionLocations);
|
|
224
|
-
try {
|
|
225
|
-
return createMacroNode(factory, parameters);
|
|
226
|
-
}
|
|
227
|
-
finally {
|
|
228
|
-
activeMacroDefinitionLocations.pop();
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
export function defineParameterizedTestBody(body) {
|
|
233
|
-
if (typeof body !== 'function') {
|
|
234
|
-
throw new TypeError('defineParameterizedTestBody() requires a body function.');
|
|
235
|
-
}
|
|
236
|
-
return function createParameterizedTestBody(data) {
|
|
237
|
-
const sourceLocations = [captureAuthoringLocation()];
|
|
238
|
-
return async function runParameterizedTestBody(scope) {
|
|
239
|
-
return forwardAssertionSourceLocations(sourceLocations, async function runBody() {
|
|
240
|
-
return body(scope, data);
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
export async function runIfMain(meta, testNode, options) {
|
|
246
|
-
if (!meta.main) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
const runModule = await import("@overkill-dev/run");
|
|
250
|
-
await runModule.runIfMain(meta, testNode, options);
|
|
251
|
-
}
|
|
252
5
|
//# sourceMappingURL=test.entry-point.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/test/test.entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"test.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/test/test.entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,WAAW,EACX,2BAA2B,EAC3B,SAAS,EACT,WAAW,EACX,KAAK,EACL,KAAK,EACL,IAAI,EACP,MAAM,qBAAqB,CAAC;AAa7B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AASvD,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,eAAe,EAClB,MAAM,6BAA6B,CAAC;AASrC,OAAO,EACH,WAAW,EACX,IAAI,EACJ,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,YAAY,EACf,MAAM,uBAAmC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type TestCase, type ThrowingTestBody } from '@overkill-dev/engine';
|
|
2
|
+
import { type AuthoringAnnotations, type AuthoringControls } from './authoring-test-data.ts';
|
|
3
|
+
export type ThrowingTestDefinition = {
|
|
4
|
+
readonly annotations?: AuthoringAnnotations;
|
|
5
|
+
readonly body: ThrowingTestBody;
|
|
6
|
+
readonly controls?: AuthoringControls;
|
|
7
|
+
readonly title: string;
|
|
8
|
+
};
|
|
9
|
+
export type ThrowingTestAuthor = {
|
|
10
|
+
(definition: Readonly<ThrowingTestDefinition>): TestCase;
|
|
11
|
+
(title: string, body: ThrowingTestBody): TestCase;
|
|
12
|
+
};
|
|
13
|
+
export declare function throwingTest(...input: readonly [definition: Readonly<ThrowingTestDefinition>]): TestCase;
|
|
14
|
+
export declare function throwingTest(...input: readonly [title: string, body: ThrowingTestBody]): TestCase;
|
|
15
|
+
//# sourceMappingURL=throwing-test-authoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throwing-test-authoring.d.ts","sourceRoot":"","sources":["../../../../../source/packages/test/throwing-test-authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,QAAQ,EAEb,KAAK,gBAAgB,EACxB,MAAM,sBAAiC,CAAC;AACzC,OAAO,EAKH,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACzB,MAAM,0BAA0B,CAAC;AAQlC,MAAM,MAAM,sBAAsB,GAAG;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B,CAAC;AASF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,CAAC,UAAU,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GAAG,QAAQ,CAAC;IACzD,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,QAAQ,CAAC;CACrD,CAAC;AAmDF,wBAAgB,YAAY,CAAC,GAAG,KAAK,EAAE,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC1G,wBAAgB,YAAY,CAAC,GAAG,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createThrowingTestCase } from "@overkill-dev/engine";
|
|
2
|
+
import { createAuthoringAnnotations, createAuthoringControls, readAuthoringAnnotations, readAuthoringControls } from "./authoring-test-data.js";
|
|
3
|
+
import { readAuthoringRecord, readAuthoringString, readAuthoringThrowingTestBody } from "./authoring-input.js";
|
|
4
|
+
import { definitionLocationsForAuthoringCall, throwingBodyForActiveMacro } from "./authoring-source-locations.js";
|
|
5
|
+
const singleArgumentCount = 1;
|
|
6
|
+
const positionalArgumentCount = 2;
|
|
7
|
+
const throwingTestArgumentsError = 'throwingTest() requires (title, body) or ({ title, annotations?, controls?, body }).';
|
|
8
|
+
function readThrowingTestDefinition(value) {
|
|
9
|
+
const definition = readAuthoringRecord(value, throwingTestArgumentsError);
|
|
10
|
+
return {
|
|
11
|
+
annotations: readAuthoringAnnotations(definition.annotations ?? {}),
|
|
12
|
+
body: readAuthoringThrowingTestBody(definition.body),
|
|
13
|
+
controls: readAuthoringControls(definition.controls ?? {}),
|
|
14
|
+
title: readAuthoringString(definition.title, throwingTestArgumentsError)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function readPositionalThrowingTestDefinition(input) {
|
|
18
|
+
const [title, body] = input;
|
|
19
|
+
return {
|
|
20
|
+
annotations: {},
|
|
21
|
+
body: readAuthoringThrowingTestBody(body),
|
|
22
|
+
controls: {},
|
|
23
|
+
title: readAuthoringString(title, throwingTestArgumentsError)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createRuntimeThrowingTest(definition) {
|
|
27
|
+
return createThrowingTestCase({
|
|
28
|
+
annotations: createAuthoringAnnotations({}, definition.annotations),
|
|
29
|
+
body: throwingBodyForActiveMacro(definition.body),
|
|
30
|
+
controls: createAuthoringControls({}, definition.controls),
|
|
31
|
+
definitionLocations: definitionLocationsForAuthoringCall(),
|
|
32
|
+
title: definition.title
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function createAuthoredThrowingTest(...input) {
|
|
36
|
+
if (input.length === singleArgumentCount) {
|
|
37
|
+
return createRuntimeThrowingTest(readThrowingTestDefinition(input[0]));
|
|
38
|
+
}
|
|
39
|
+
if (input.length === positionalArgumentCount) {
|
|
40
|
+
return createRuntimeThrowingTest(readPositionalThrowingTestDefinition(input));
|
|
41
|
+
}
|
|
42
|
+
throw new TypeError(throwingTestArgumentsError);
|
|
43
|
+
}
|
|
44
|
+
export function throwingTest(...input) {
|
|
45
|
+
return createAuthoredThrowingTest(...input);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=throwing-test-authoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throwing-test-authoring.js","sourceRoot":"","sources":["../../../../../source/packages/test/throwing-test-authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,sBAAsB,EAKzB,MAAM,sBAAiC,CAAC;AACzC,OAAO,EACH,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EAGxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,mBAAmB,EACnB,mBAAmB,EACnB,6BAA6B,EAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mCAAmC,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAqBlH,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAClC,MAAM,0BAA0B,GAC5B,sFAAsF,CAAC;AAE3F,SAAS,0BAA0B,CAAC,KAAc;IAC9C,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC;IAE1E,OAAO;QACH,WAAW,EAAE,wBAAwB,CAAC,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC;QACnE,IAAI,EAAE,6BAA6B,CAAC,UAAU,CAAC,IAAI,CAAC;QACpD,QAAQ,EAAE,qBAAqB,CAAC,UAAU,CAAC,QAAQ,IAAI,EAAE,CAAC;QAC1D,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,KAAK,EAAE,0BAA0B,CAAC;KAC3E,CAAC;AACN,CAAC;AAED,SAAS,oCAAoC,CAAC,KAAyB;IACnE,MAAM,CAAE,KAAK,EAAE,IAAI,CAAE,GAAG,KAAK,CAAC;IAE9B,OAAO;QACH,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,6BAA6B,CAAC,IAAI,CAAC;QACzC,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,mBAAmB,CAAC,KAAK,EAAE,0BAA0B,CAAC;KAChE,CAAC;AACN,CAAC;AAED,SAAS,yBAAyB,CAAC,UAAyC;IACxE,OAAO,sBAAsB,CAAC;QAC1B,WAAW,EAAE,0BAA0B,CAAC,EAAE,EAAE,UAAU,CAAC,WAAW,CAAC;QACnE,IAAI,EAAE,0BAA0B,CAAC,UAAU,CAAC,IAAI,CAAC;QACjD,QAAQ,EAAE,uBAAuB,CAAC,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC;QAC1D,mBAAmB,EAAE,mCAAmC,EAAE;QAC1D,KAAK,EAAE,UAAU,CAAC,KAAK;KAC1B,CAAC,CAAC;AACP,CAAC;AAED,SAAS,0BAA0B,CAAC,GAAG,KAAyB;IAC5D,IAAI,KAAK,CAAC,MAAM,KAAK,mBAAmB,EAAE,CAAC;QACvC,OAAO,yBAAyB,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,uBAAuB,EAAE,CAAC;QAC3C,OAAO,yBAAyB,CAAC,oCAAoC,CAAC,KAAK,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;AACpD,CAAC;AAID,MAAM,UAAU,YAAY,CAAC,GAAG,KAAyB;IACrD,OAAO,0BAA0B,CAAC,GAAG,KAAK,CAAC,CAAC;AAChD,CAAC"}
|