@cydran/testsupport 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/testsupport.d.ts +118 -40
- package/dist/testsupport.js +290 -273
- package/dist/testsupport.js.map +4 -4
- package/dist/testsupport.min.js +66 -0
- package/dist/testsupport.min.js.map +7 -0
- package/dist/testsupport.min.mjs +33 -0
- package/dist/testsupport.min.mjs.map +7 -0
- package/dist/testsupport.mjs +261 -0
- package/dist/testsupport.mjs.map +7 -0
- package/package.json +44 -19
package/dist/testsupport.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
|
-
0.
|
|
2
|
+
0.6.0
|
|
3
3
|
---
|
|
4
|
-
Cydran <
|
|
5
|
-
Copyright (c) 2018 The Cydran Team
|
|
6
|
-
|
|
4
|
+
Cydran <https://cydran.io/>
|
|
5
|
+
Copyright (c) 2018-2026 The Cydran Team <https://cydran.io/>
|
|
6
|
+
SPDX-License-Identifier: MIT
|
|
7
7
|
---
|
|
8
8
|
Derivative work based on Lodash 4.17.15 <https://lodash.com/license>
|
|
9
9
|
Copyright (c) 2019 OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -21,35 +21,75 @@ Derivative work based on UMD <https://github.com/umdjs/umd/blob/master/LICENSE.m
|
|
|
21
21
|
Copyright (c) 2014 the UMD contributors <https://github.com/umdjs/umd/>
|
|
22
22
|
|
|
23
23
|
*/
|
|
24
|
+
(function (root, factory) {
|
|
25
|
+
var ids = ["@cydran/cydran","@jest/globals","@testing-library/dom","jsdom"];
|
|
26
|
+
var globals = {"@cydran/cydran":"cydran"};
|
|
27
|
+
if (typeof define === "function" && define.amd) {
|
|
28
|
+
define(["exports"].concat(ids), function (exports) {
|
|
29
|
+
var values = Array.prototype.slice.call(arguments, 1);
|
|
30
|
+
factory(exports, function (id) {
|
|
31
|
+
return values[ids.indexOf(id)];
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
} else if (typeof exports === "object" && typeof exports.nodeName !== "string") {
|
|
35
|
+
factory(exports, typeof require === "function" ? require : function (id) {
|
|
36
|
+
throw new Error("testsupport: dependency " + id + " cannot be loaded: require is not available");
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
var target = {};
|
|
40
|
+
factory(target, function (id) {
|
|
41
|
+
var value = Object.prototype.hasOwnProperty.call(globals, id) ? root[globals[id]] : undefined;
|
|
42
|
+
if (value === undefined) {
|
|
43
|
+
throw new Error("testsupport: dependency " + id + " is not available as a global");
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
46
|
+
});
|
|
47
|
+
root["testsupport"] = target;
|
|
48
|
+
}
|
|
49
|
+
})(typeof self !== "undefined" ? self : this, function (exports, require) {
|
|
24
50
|
"use strict";
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
51
|
+
var module = { exports: {} };
|
|
52
|
+
var __defProp = Object.defineProperty;
|
|
53
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
54
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
55
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
56
|
+
var __export = (target, all) => {
|
|
57
|
+
for (var name in all)
|
|
58
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
59
|
+
};
|
|
60
|
+
var __copyProps = (to, from, except, desc) => {
|
|
61
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
62
|
+
for (let key of __getOwnPropNames(from))
|
|
63
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
64
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
65
|
+
}
|
|
66
|
+
return to;
|
|
67
|
+
};
|
|
68
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
69
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
70
|
+
// target/js/index.js
|
|
71
|
+
var js_exports = {};
|
|
72
|
+
__export(js_exports, {
|
|
73
|
+
Harness: () => Harness_default,
|
|
74
|
+
isDefined: () => isDefined2,
|
|
75
|
+
merge: () => merge2,
|
|
76
|
+
overlay: () => overlay,
|
|
77
|
+
requireNotNull: () => requireNotNull2
|
|
78
|
+
});
|
|
79
|
+
module.exports = __toCommonJS(js_exports);
|
|
80
|
+
|
|
81
|
+
// target/js/harness/Harness.js
|
|
82
|
+
var import_jsdom = require("jsdom");
|
|
83
|
+
var import_cydran = require("@cydran/cydran");
|
|
84
|
+
var import_dom = require("@testing-library/dom");
|
|
85
|
+
var import_globals = require("@jest/globals");
|
|
86
|
+
var TestComponent = class extends import_cydran.Component {
|
|
87
|
+
constructor() {
|
|
88
|
+
super("<div></div>");
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
var DEFAULT_COMPONENT_SUPPLIER = () => new TestComponent();
|
|
92
|
+
var HTML = `<!doctype html>
|
|
53
93
|
<html lang="en">
|
|
54
94
|
<head>
|
|
55
95
|
<title>Cydran Test Harness</title>
|
|
@@ -58,250 +98,227 @@ var testsupport = (() => {
|
|
|
58
98
|
<!-- Stage Content -->
|
|
59
99
|
</body>
|
|
60
100
|
</html>`;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
return this;
|
|
177
|
-
}
|
|
178
|
-
getComponent() {
|
|
179
|
-
return this.root;
|
|
180
|
-
}
|
|
181
|
-
getWindow() {
|
|
182
|
-
return this.window;
|
|
183
|
-
}
|
|
184
|
-
getDocument() {
|
|
185
|
-
return this.document;
|
|
186
|
-
}
|
|
187
|
-
getContext() {
|
|
188
|
-
return this.stage.getContext();
|
|
189
|
-
}
|
|
190
|
-
getStage() {
|
|
191
|
-
return this.stage;
|
|
192
|
-
}
|
|
193
|
-
registerConstant(id, instance) {
|
|
194
|
-
this.stage.getContext().registerConstant(id, instance);
|
|
195
|
-
}
|
|
196
|
-
registerPrototype(id, classInstance, resolvers) {
|
|
197
|
-
this.stage.getContext().registerPrototype(id, classInstance, resolvers);
|
|
198
|
-
}
|
|
199
|
-
registerSingleton(id, classInstance, resolvers) {
|
|
200
|
-
this.stage.getContext().registerSingleton(id, classInstance, resolvers);
|
|
201
|
-
}
|
|
202
|
-
registerConstantGlobally(id, instance) {
|
|
203
|
-
this.stage.getContext()["obscuredParent"].registerConstant(id, instance);
|
|
204
|
-
}
|
|
205
|
-
registerPrototypeGlobally(id, classInstance, resolvers) {
|
|
206
|
-
this.stage.getContext()["obscuredParent"].registerPrototype(id, classInstance, resolvers);
|
|
207
|
-
}
|
|
208
|
-
registerSingletonGlobally(id, classInstance, resolvers) {
|
|
209
|
-
this.stage.getContext()["obscuredParent"].registerSingleton(id, classInstance, resolvers);
|
|
210
|
-
}
|
|
211
|
-
forRole(value) {
|
|
212
|
-
return new OperationsImpl(this.document.documentElement, value, "Role");
|
|
213
|
-
}
|
|
214
|
-
forLabelText(value) {
|
|
215
|
-
return new OperationsImpl(this.document.documentElement, value, "LabelText");
|
|
216
|
-
}
|
|
217
|
-
forPlaceholderText(value) {
|
|
218
|
-
return new OperationsImpl(this.document.documentElement, value, "PlaceholderText");
|
|
219
|
-
}
|
|
220
|
-
forText(value) {
|
|
221
|
-
return new OperationsImpl(this.document.documentElement, value, "Text");
|
|
222
|
-
}
|
|
223
|
-
forDisplayValue(value) {
|
|
224
|
-
return new OperationsImpl(this.document.documentElement, value, "DisplayValue");
|
|
225
|
-
}
|
|
226
|
-
forAltText(value) {
|
|
227
|
-
return new OperationsImpl(this.document.documentElement, value, "AltText");
|
|
228
|
-
}
|
|
229
|
-
forTitle(value) {
|
|
230
|
-
return new OperationsImpl(this.document.documentElement, value, "Title");
|
|
231
|
-
}
|
|
232
|
-
forTestId(value) {
|
|
233
|
-
return new OperationsImpl(this.document.documentElement, value, "TestId");
|
|
234
|
-
}
|
|
235
|
-
expectBody() {
|
|
236
|
-
return (0, globals_1.expect)(this.document.body.innerHTML);
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
exports.default = Harness;
|
|
101
|
+
var ExpectionActionsImpl = class {
|
|
102
|
+
constructor(element) {
|
|
103
|
+
this.element = (0, import_cydran.requireNotNull)(element, "element");
|
|
104
|
+
}
|
|
105
|
+
selectedValues() {
|
|
106
|
+
const selected = [];
|
|
107
|
+
for (let i = 0; i < this.element["selectedOptions"].length; i++) {
|
|
108
|
+
const option = this.element["selectedOptions"][i];
|
|
109
|
+
selected.push(option.value);
|
|
110
|
+
}
|
|
111
|
+
return (0, import_globals.expect)(selected);
|
|
112
|
+
}
|
|
113
|
+
trimmedTextContent() {
|
|
114
|
+
return (0, import_globals.expect)(this.element.textContent.trim());
|
|
115
|
+
}
|
|
116
|
+
textContent() {
|
|
117
|
+
return (0, import_globals.expect)(this.element.textContent);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
var OperationsImpl = class {
|
|
121
|
+
constructor(element, value, type) {
|
|
122
|
+
this.element = (0, import_cydran.requireNotNull)(element, "element");
|
|
123
|
+
this.value = (0, import_cydran.requireNotNull)(value, "value");
|
|
124
|
+
this.type = (0, import_cydran.requireNotNull)(type, "type");
|
|
125
|
+
}
|
|
126
|
+
get(options) {
|
|
127
|
+
return this.execute("get", options);
|
|
128
|
+
}
|
|
129
|
+
query(options) {
|
|
130
|
+
return this.execute("query", options);
|
|
131
|
+
}
|
|
132
|
+
find(options) {
|
|
133
|
+
return this.execute("find", options);
|
|
134
|
+
}
|
|
135
|
+
getAll(options) {
|
|
136
|
+
return this.execute("getAll", options);
|
|
137
|
+
}
|
|
138
|
+
queryAll(options) {
|
|
139
|
+
return this.execute("queryAll", options);
|
|
140
|
+
}
|
|
141
|
+
findAll(options) {
|
|
142
|
+
return this.execute("findAll", options);
|
|
143
|
+
}
|
|
144
|
+
expect(options) {
|
|
145
|
+
const element = this.get(options);
|
|
146
|
+
return new ExpectionActionsImpl(element);
|
|
147
|
+
}
|
|
148
|
+
appendText(text, options) {
|
|
149
|
+
const element = this.get(options);
|
|
150
|
+
element.value = element.value + text;
|
|
151
|
+
import_dom.fireEvent.input(element);
|
|
152
|
+
}
|
|
153
|
+
replaceText(text, options) {
|
|
154
|
+
const element = this.get(options);
|
|
155
|
+
element.value = text;
|
|
156
|
+
import_dom.fireEvent.input(element);
|
|
157
|
+
}
|
|
158
|
+
selectIndex(index, options) {
|
|
159
|
+
const element = this.get(options);
|
|
160
|
+
element.selectedIndex = index;
|
|
161
|
+
import_dom.fireEvent.change(element);
|
|
162
|
+
}
|
|
163
|
+
selectIndexes(indexes, options) {
|
|
164
|
+
const element = this.get(options);
|
|
165
|
+
for (let i = 0; i < element.options.length; i++) {
|
|
166
|
+
const option = element.options[i];
|
|
167
|
+
option.selected = false;
|
|
168
|
+
}
|
|
169
|
+
for (let i = 0; i < indexes.length; i++) {
|
|
170
|
+
const index = indexes[i];
|
|
171
|
+
const option = element.options[index];
|
|
172
|
+
option.selected = true;
|
|
173
|
+
}
|
|
174
|
+
import_dom.fireEvent.change(element);
|
|
175
|
+
}
|
|
176
|
+
setCheckedState(value, options) {
|
|
177
|
+
const element = this.get(options);
|
|
178
|
+
element.checked = value;
|
|
179
|
+
import_dom.fireEvent.input(element);
|
|
180
|
+
}
|
|
181
|
+
execute(name, options) {
|
|
182
|
+
const methodName = name + "By" + this.type;
|
|
183
|
+
return import_dom.queries[methodName](this.element, this.value, options);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
var Harness = class {
|
|
187
|
+
constructor(rootSupplier = DEFAULT_COMPONENT_SUPPLIER, properties) {
|
|
188
|
+
this.rootSupplier = (0, import_cydran.requireNotNull)(rootSupplier, "rootSupplier");
|
|
189
|
+
this.actualProperties = (0, import_cydran.isDefined)(properties) ? properties : {};
|
|
190
|
+
this.reset();
|
|
191
|
+
}
|
|
192
|
+
reset() {
|
|
193
|
+
this.stop();
|
|
194
|
+
this.window = new import_jsdom.JSDOM(HTML).window;
|
|
195
|
+
this.document = this.window.document;
|
|
196
|
+
const defaultProperties = {
|
|
197
|
+
[import_cydran.PropertyKeys.CYDRAN_STARTUP_SYNCHRONOUS]: true,
|
|
198
|
+
[import_cydran.PropertyKeys.CYDRAN_LOG_LEVEL]: "WARN",
|
|
199
|
+
[import_cydran.PropertyKeys.CYDRAN_OVERRIDE_WINDOW]: this.window
|
|
200
|
+
};
|
|
201
|
+
this.initialProperties = (0, import_cydran.merge)([defaultProperties, this.actualProperties]);
|
|
202
|
+
this.stage = (0, import_cydran.create)("body", this.initialProperties);
|
|
203
|
+
this.stage.addInitializer({}, (stage) => {
|
|
204
|
+
this.root = this.rootSupplier();
|
|
205
|
+
stage.setComponent(this.root);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
start() {
|
|
209
|
+
this.stage.start();
|
|
210
|
+
return this;
|
|
211
|
+
}
|
|
212
|
+
stop() {
|
|
213
|
+
if ((0, import_cydran.isDefined)(this.stage) && this.stage.isStarted()) {
|
|
214
|
+
this.stage.$release();
|
|
240
215
|
}
|
|
241
|
-
|
|
216
|
+
return this;
|
|
217
|
+
}
|
|
218
|
+
getComponent() {
|
|
219
|
+
return this.root;
|
|
220
|
+
}
|
|
221
|
+
getWindow() {
|
|
222
|
+
return this.window;
|
|
223
|
+
}
|
|
224
|
+
getDocument() {
|
|
225
|
+
return this.document;
|
|
226
|
+
}
|
|
227
|
+
getContext() {
|
|
228
|
+
return this.stage.getContext();
|
|
229
|
+
}
|
|
230
|
+
getStage() {
|
|
231
|
+
return this.stage;
|
|
232
|
+
}
|
|
233
|
+
registerConstant(id, instance) {
|
|
234
|
+
this.stage.getContext().registerConstant(id, instance);
|
|
235
|
+
}
|
|
236
|
+
registerPrototype(id, classInstance, resolvers) {
|
|
237
|
+
this.stage.getContext().registerPrototype(id, classInstance, resolvers);
|
|
238
|
+
}
|
|
239
|
+
registerSingleton(id, classInstance, resolvers) {
|
|
240
|
+
this.stage.getContext().registerSingleton(id, classInstance, resolvers);
|
|
241
|
+
}
|
|
242
|
+
registerConstantGlobally(id, instance) {
|
|
243
|
+
this.stage.getContext()["obscuredParent"].registerConstant(id, instance);
|
|
244
|
+
}
|
|
245
|
+
registerPrototypeGlobally(id, classInstance, resolvers) {
|
|
246
|
+
this.stage.getContext()["obscuredParent"].registerPrototype(id, classInstance, resolvers);
|
|
247
|
+
}
|
|
248
|
+
registerSingletonGlobally(id, classInstance, resolvers) {
|
|
249
|
+
this.stage.getContext()["obscuredParent"].registerSingleton(id, classInstance, resolvers);
|
|
250
|
+
}
|
|
251
|
+
forRole(value) {
|
|
252
|
+
return new OperationsImpl(this.document.documentElement, value, "Role");
|
|
253
|
+
}
|
|
254
|
+
forLabelText(value) {
|
|
255
|
+
return new OperationsImpl(this.document.documentElement, value, "LabelText");
|
|
256
|
+
}
|
|
257
|
+
forPlaceholderText(value) {
|
|
258
|
+
return new OperationsImpl(this.document.documentElement, value, "PlaceholderText");
|
|
259
|
+
}
|
|
260
|
+
forText(value) {
|
|
261
|
+
return new OperationsImpl(this.document.documentElement, value, "Text");
|
|
262
|
+
}
|
|
263
|
+
forDisplayValue(value) {
|
|
264
|
+
return new OperationsImpl(this.document.documentElement, value, "DisplayValue");
|
|
265
|
+
}
|
|
266
|
+
forAltText(value) {
|
|
267
|
+
return new OperationsImpl(this.document.documentElement, value, "AltText");
|
|
268
|
+
}
|
|
269
|
+
forTitle(value) {
|
|
270
|
+
return new OperationsImpl(this.document.documentElement, value, "Title");
|
|
271
|
+
}
|
|
272
|
+
forTestId(value) {
|
|
273
|
+
return new OperationsImpl(this.document.documentElement, value, "TestId");
|
|
274
|
+
}
|
|
275
|
+
expectBody() {
|
|
276
|
+
return (0, import_globals.expect)(this.document.body.innerHTML);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var Harness_default = Harness;
|
|
242
280
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
requireNotNull(sources, "sources");
|
|
268
|
-
return overlay({}, sources);
|
|
269
|
-
}
|
|
270
|
-
function overlay(destination, sources) {
|
|
271
|
-
requireNotNull(destination, "destination");
|
|
272
|
-
requireNotNull(sources, "sources");
|
|
273
|
-
for (const source of sources) {
|
|
274
|
-
if (!isDefined(source)) {
|
|
275
|
-
continue;
|
|
276
|
-
}
|
|
277
|
-
for (const name of Object.keys(source)) {
|
|
278
|
-
if (!isDefined(source[name])) {
|
|
279
|
-
continue;
|
|
280
|
-
}
|
|
281
|
-
destination[name] = source[name];
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
return destination;
|
|
281
|
+
// target/js/index.js
|
|
282
|
+
function isDefined2(value) {
|
|
283
|
+
return value !== null && value !== void 0;
|
|
284
|
+
}
|
|
285
|
+
function requireNotNull2(value, name) {
|
|
286
|
+
if (value === null || value === void 0) {
|
|
287
|
+
throw new Error(`${name} shall not be null`);
|
|
288
|
+
}
|
|
289
|
+
return value;
|
|
290
|
+
}
|
|
291
|
+
function merge2(sources) {
|
|
292
|
+
requireNotNull2(sources, "sources");
|
|
293
|
+
return overlay({}, sources);
|
|
294
|
+
}
|
|
295
|
+
function overlay(destination, sources) {
|
|
296
|
+
requireNotNull2(destination, "destination");
|
|
297
|
+
requireNotNull2(sources, "sources");
|
|
298
|
+
for (const source of sources) {
|
|
299
|
+
if (!isDefined2(source)) {
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
for (const name of Object.keys(source)) {
|
|
303
|
+
if (!isDefined2(source[name])) {
|
|
304
|
+
continue;
|
|
285
305
|
}
|
|
306
|
+
destination[name] = source[name];
|
|
286
307
|
}
|
|
287
|
-
}
|
|
288
|
-
return
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
})(typeof self !== 'undefined' ? self : this, function(exports, c) {
|
|
304
|
-
c.overlay(exports, [c]);
|
|
305
|
-
}, testsupport);
|
|
306
|
-
|
|
308
|
+
}
|
|
309
|
+
return destination;
|
|
310
|
+
}
|
|
311
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
312
|
+
0 && (module.exports = {
|
|
313
|
+
Harness,
|
|
314
|
+
isDefined,
|
|
315
|
+
merge,
|
|
316
|
+
overlay,
|
|
317
|
+
requireNotNull
|
|
318
|
+
});
|
|
319
|
+
var source = module.exports;
|
|
320
|
+
Object.getOwnPropertyNames(source).forEach(function (key) {
|
|
321
|
+
Object.defineProperty(exports, key, Object.getOwnPropertyDescriptor(source, key));
|
|
322
|
+
});
|
|
323
|
+
});
|
|
307
324
|
//# sourceMappingURL=testsupport.js.map
|