@rstest/core 0.6.0 → 0.6.2
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.md +0 -14
- package/dist/0~171.js +4 -6
- package/dist/0~204.js +67 -77
- package/dist/0~263.js +1423 -0
- package/dist/0~350.js +30 -373
- package/dist/0~365.js +92 -0
- package/dist/0~463.js +331 -0
- package/dist/0~470.js +382 -0
- package/dist/0~535.js +10 -0
- package/dist/0~607.js +119 -0
- package/dist/0~610.js +10 -0
- package/dist/0~673.js +10 -0
- package/dist/0~691.js +74 -82
- package/dist/0~711.js +30 -373
- package/dist/0~763.js +10 -0
- package/dist/0~764.js +13284 -0
- package/dist/0~814.js +900 -0
- package/dist/0~830.js +1130 -0
- package/dist/0~836.js +13 -21
- package/dist/0~971.js +130 -136
- package/dist/597.js +174 -0
- package/dist/603.js +41 -0
- package/dist/808.js +167 -0
- package/dist/857.js +3252 -0
- package/dist/index.js +2394 -5971
- package/dist/mockRuntimeCode.js +11 -4
- package/dist/runtime.js +60 -0
- package/dist/worker.js +155 -1389
- package/dist-types/index.d.ts +25 -3
- package/dist-types/worker.d.ts +9 -2
- package/package.json +3 -3
- package/dist/0~33.js +0 -425
- package/dist/0~414.js +0 -16
- package/dist/0~493.js +0 -126
- package/dist/0~603.js +0 -50
- package/dist/0~628.js +0 -1089
- package/dist/0~655.js +0 -11533
- package/dist/0~85.js +0 -1819
- package/dist/0~873.js +0 -1220
- package/dist/0~928.js +0 -1432
- package/dist/0~967.js +0 -99
- /package/dist/{0~928.js.LICENSE.txt → 0~263.js.LICENSE.txt} +0 -0
- /package/dist/{0~655.js.LICENSE.txt → 0~764.js.LICENSE.txt} +0 -0
package/dist/0~691.js
CHANGED
|
@@ -1,87 +1,79 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { __webpack_require__ } from "./runtime.js";
|
|
4
|
+
import { pathe_M_eThtNZ_relative } from "./857.js";
|
|
5
|
+
const picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js");
|
|
6
|
+
var picomatch_default = /*#__PURE__*/ __webpack_require__.n(picomatch);
|
|
7
|
+
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
8
|
+
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
9
|
+
const THRESHOLD_KEYS = [
|
|
10
|
+
'lines',
|
|
11
|
+
'functions',
|
|
12
|
+
'statements',
|
|
13
|
+
'branches'
|
|
6
14
|
];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
perFile: false
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
for (const key of Object.keys(thresholds)){
|
|
41
|
-
if (THRESHOLD_KEYS.includes(key) || 'object' != typeof thresholds[key]) continue;
|
|
42
|
-
const globCoverageMap = coverageProvider.createCoverageMap();
|
|
43
|
-
const matcher = picomatch__WEBPACK_IMPORTED_MODULE_1___default()(key);
|
|
44
|
-
const matchedFiles = allFiles.filter((file)=>matcher((0, pathe__WEBPACK_IMPORTED_MODULE_2__.b)(rootPath, file)));
|
|
45
|
-
if (!matchedFiles.length) {
|
|
46
|
-
failedThresholds.push(`${_utils__WEBPACK_IMPORTED_MODULE_0__.yW.red('Error')}: coverage data for "${key}" was not found`);
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
for (const file of matchedFiles){
|
|
50
|
-
const fileCoverage = coverageMap.fileCoverageFor(file);
|
|
51
|
-
globCoverageMap.addFileCoverage(fileCoverage);
|
|
52
|
-
}
|
|
53
|
-
thresholdGroup.push({
|
|
54
|
-
...thresholds[key],
|
|
55
|
-
name: key,
|
|
56
|
-
coverageMap: globCoverageMap
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
const check = (name, type, actual, expected, file)=>{
|
|
60
|
-
let errorMsg = '';
|
|
61
|
-
if (void 0 !== expected) {
|
|
62
|
-
if (expected < 0) {
|
|
63
|
-
const uncovered = actual.total - actual.covered;
|
|
64
|
-
if (uncovered > -expected) errorMsg += `uncovered ${name} ${_utils__WEBPACK_IMPORTED_MODULE_0__.yW.red(`${uncovered}`)} exceeds maximum ${'global' === type ? 'global' : `"${type}"`} threshold allowed ${_utils__WEBPACK_IMPORTED_MODULE_0__.yW.yellow(`${-expected}`)}`;
|
|
65
|
-
} else if (actual.pct < expected) errorMsg += `coverage for ${name} ${_utils__WEBPACK_IMPORTED_MODULE_0__.yW.red(`${actual.pct}%`)} does not meet ${'global' === type ? 'global' : `"${type}"`} threshold ${_utils__WEBPACK_IMPORTED_MODULE_0__.yW.yellow(`${expected}%`)}`;
|
|
66
|
-
}
|
|
67
|
-
if (errorMsg) failedThresholds.push(`${_utils__WEBPACK_IMPORTED_MODULE_0__.yW.red('Error')}: ${file ? `${(0, pathe__WEBPACK_IMPORTED_MODULE_2__.b)(rootPath, file)} ` : ''}${errorMsg}`);
|
|
68
|
-
};
|
|
69
|
-
thresholdGroup.forEach(({ name, coverageMap, ...thresholds })=>{
|
|
70
|
-
const summaries = thresholds.perFile ? coverageMap.files().map((file)=>({
|
|
71
|
-
file,
|
|
72
|
-
summary: coverageMap.fileCoverageFor(file).toSummary()
|
|
73
|
-
})) : [
|
|
74
|
-
{
|
|
75
|
-
file: '',
|
|
76
|
-
summary: coverageMap.getCoverageSummary()
|
|
77
|
-
}
|
|
78
|
-
];
|
|
79
|
-
for (const { summary, file } of summaries)for (const key of THRESHOLD_KEYS)if (void 0 !== thresholds[key]) check(key, name, summary[key], thresholds[key], file);
|
|
80
|
-
});
|
|
81
|
-
return {
|
|
82
|
-
success: 0 === failedThresholds.length,
|
|
83
|
-
message: failedThresholds.join('\n')
|
|
84
|
-
};
|
|
15
|
+
function checkThresholds({ coverageMap, thresholds, coverageProvider, rootPath }) {
|
|
16
|
+
if (!thresholds) return {
|
|
17
|
+
success: true,
|
|
18
|
+
message: ''
|
|
19
|
+
};
|
|
20
|
+
const failedThresholds = [];
|
|
21
|
+
const allFiles = coverageMap.files();
|
|
22
|
+
const thresholdGroup = [
|
|
23
|
+
{
|
|
24
|
+
statements: thresholds.statements,
|
|
25
|
+
functions: thresholds.functions,
|
|
26
|
+
branches: thresholds.branches,
|
|
27
|
+
lines: thresholds.lines,
|
|
28
|
+
name: 'global',
|
|
29
|
+
coverageMap,
|
|
30
|
+
perFile: false
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
for (const key of Object.keys(thresholds)){
|
|
34
|
+
if (THRESHOLD_KEYS.includes(key) || 'object' != typeof thresholds[key]) continue;
|
|
35
|
+
const globCoverageMap = coverageProvider.createCoverageMap();
|
|
36
|
+
const matcher = picomatch_default()(key);
|
|
37
|
+
const matchedFiles = allFiles.filter((file)=>matcher(pathe_M_eThtNZ_relative(rootPath, file)));
|
|
38
|
+
if (!matchedFiles.length) {
|
|
39
|
+
failedThresholds.push(`${picocolors_default().red('Error')}: coverage data for "${key}" was not found`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
for (const file of matchedFiles){
|
|
43
|
+
const fileCoverage = coverageMap.fileCoverageFor(file);
|
|
44
|
+
globCoverageMap.addFileCoverage(fileCoverage);
|
|
85
45
|
}
|
|
46
|
+
thresholdGroup.push({
|
|
47
|
+
...thresholds[key],
|
|
48
|
+
name: key,
|
|
49
|
+
coverageMap: globCoverageMap
|
|
50
|
+
});
|
|
86
51
|
}
|
|
87
|
-
|
|
52
|
+
const check = (name, type, actual, expected, file)=>{
|
|
53
|
+
let errorMsg = '';
|
|
54
|
+
if (void 0 !== expected) {
|
|
55
|
+
if (expected < 0) {
|
|
56
|
+
const uncovered = actual.total - actual.covered;
|
|
57
|
+
if (uncovered > -expected) errorMsg += `uncovered ${name} ${picocolors_default().red(`${uncovered}`)} exceeds maximum ${'global' === type ? 'global' : `"${type}"`} threshold allowed ${picocolors_default().yellow(`${-expected}`)}`;
|
|
58
|
+
} else if (actual.pct < expected) errorMsg += `coverage for ${name} ${picocolors_default().red(`${actual.pct}%`)} does not meet ${'global' === type ? 'global' : `"${type}"`} threshold ${picocolors_default().yellow(`${expected}%`)}`;
|
|
59
|
+
}
|
|
60
|
+
if (errorMsg) failedThresholds.push(`${picocolors_default().red('Error')}: ${file ? `${pathe_M_eThtNZ_relative(rootPath, file)} ` : ''}${errorMsg}`);
|
|
61
|
+
};
|
|
62
|
+
thresholdGroup.forEach(({ name, coverageMap, ...thresholds })=>{
|
|
63
|
+
const summaries = thresholds.perFile ? coverageMap.files().map((file)=>({
|
|
64
|
+
file,
|
|
65
|
+
summary: coverageMap.fileCoverageFor(file).toSummary()
|
|
66
|
+
})) : [
|
|
67
|
+
{
|
|
68
|
+
file: '',
|
|
69
|
+
summary: coverageMap.getCoverageSummary()
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
for (const { summary, file } of summaries)for (const key of THRESHOLD_KEYS)if (void 0 !== thresholds[key]) check(key, name, summary[key], thresholds[key], file);
|
|
73
|
+
});
|
|
74
|
+
return {
|
|
75
|
+
success: 0 === failedThresholds.length,
|
|
76
|
+
message: failedThresholds.join('\n')
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export { checkThresholds };
|
package/dist/0~711.js
CHANGED
|
@@ -1,380 +1,37 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { __webpack_require__ } from "./runtime.js";
|
|
4
|
+
import { checkPkgInstalled } from "./worker.js";
|
|
5
|
+
import { installGlobal, addDefaultErrorHandler } from "./0~463.js";
|
|
6
|
+
const environment = {
|
|
7
|
+
name: 'jsdom',
|
|
8
|
+
async setup (global, { jsdom = {} }) {
|
|
9
|
+
checkPkgInstalled('jsdom');
|
|
10
|
+
const { CookieJar, JSDOM, ResourceLoader, VirtualConsole } = await import("./0~673.js").then(__webpack_require__.bind(__webpack_require__, "jsdom"));
|
|
11
|
+
const { html = '<!DOCTYPE html>', userAgent, url = 'http://localhost:3000', contentType = 'text/html', pretendToBeVisual = true, includeNodeLocations = false, runScripts = 'dangerously', resources, console = false, cookieJar = false, ...restOptions } = jsdom;
|
|
12
|
+
const dom = new JSDOM(html, {
|
|
13
|
+
pretendToBeVisual,
|
|
14
|
+
resources: resources ?? (userAgent ? new ResourceLoader({
|
|
15
|
+
userAgent
|
|
16
|
+
}) : void 0),
|
|
17
|
+
runScripts,
|
|
18
|
+
url,
|
|
19
|
+
virtualConsole: console && global.console ? new VirtualConsole().sendTo(global.console) : void 0,
|
|
20
|
+
cookieJar: cookieJar ? new CookieJar() : void 0,
|
|
21
|
+
includeNodeLocations,
|
|
22
|
+
contentType,
|
|
23
|
+
userAgent,
|
|
24
|
+
...restOptions
|
|
11
25
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const { html = '<!DOCTYPE html>', userAgent, url = 'http://localhost:3000', contentType = 'text/html', pretendToBeVisual = true, includeNodeLocations = false, runScripts = 'dangerously', resources, console = false, cookieJar = false, ...restOptions } = jsdom;
|
|
20
|
-
const dom = new JSDOM(html, {
|
|
21
|
-
pretendToBeVisual,
|
|
22
|
-
resources: resources ?? (userAgent ? new ResourceLoader({
|
|
23
|
-
userAgent
|
|
24
|
-
}) : void 0),
|
|
25
|
-
runScripts,
|
|
26
|
-
url,
|
|
27
|
-
virtualConsole: console && global.console ? new VirtualConsole().sendTo(global.console) : void 0,
|
|
28
|
-
cookieJar: cookieJar ? new CookieJar() : void 0,
|
|
29
|
-
includeNodeLocations,
|
|
30
|
-
contentType,
|
|
31
|
-
userAgent,
|
|
32
|
-
...restOptions
|
|
33
|
-
});
|
|
34
|
-
const cleanupGlobal = (0, _utils__WEBPACK_IMPORTED_MODULE_1__.p5)(global, dom.window);
|
|
35
|
-
const cleanupHandler = (0, _utils__WEBPACK_IMPORTED_MODULE_1__.d1)(global);
|
|
36
|
-
return {
|
|
37
|
-
teardown () {
|
|
38
|
-
cleanupHandler();
|
|
39
|
-
dom.window.close();
|
|
40
|
-
cleanupGlobal();
|
|
41
|
-
}
|
|
42
|
-
};
|
|
26
|
+
const cleanupGlobal = installGlobal(global, dom.window);
|
|
27
|
+
const cleanupHandler = addDefaultErrorHandler(global);
|
|
28
|
+
return {
|
|
29
|
+
teardown () {
|
|
30
|
+
cleanupHandler();
|
|
31
|
+
dom.window.close();
|
|
32
|
+
cleanupGlobal();
|
|
43
33
|
}
|
|
44
34
|
};
|
|
45
|
-
},
|
|
46
|
-
"./src/runtime/worker/env/utils.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
47
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
48
|
-
d1: ()=>addDefaultErrorHandler,
|
|
49
|
-
p5: ()=>installGlobal
|
|
50
|
-
});
|
|
51
|
-
const LIVING_KEYS = [
|
|
52
|
-
'DOMException',
|
|
53
|
-
'URL',
|
|
54
|
-
'URLSearchParams',
|
|
55
|
-
'EventTarget',
|
|
56
|
-
'NamedNodeMap',
|
|
57
|
-
'Node',
|
|
58
|
-
'Attr',
|
|
59
|
-
'Element',
|
|
60
|
-
'DocumentFragment',
|
|
61
|
-
'DOMImplementation',
|
|
62
|
-
'Document',
|
|
63
|
-
'XMLDocument',
|
|
64
|
-
'CharacterData',
|
|
65
|
-
'Text',
|
|
66
|
-
'CDATASection',
|
|
67
|
-
'ProcessingInstruction',
|
|
68
|
-
'Comment',
|
|
69
|
-
'DocumentType',
|
|
70
|
-
'NodeList',
|
|
71
|
-
'RadioNodeList',
|
|
72
|
-
'HTMLCollection',
|
|
73
|
-
'HTMLOptionsCollection',
|
|
74
|
-
'DOMStringMap',
|
|
75
|
-
'DOMTokenList',
|
|
76
|
-
'StyleSheetList',
|
|
77
|
-
'HTMLElement',
|
|
78
|
-
'HTMLHeadElement',
|
|
79
|
-
'HTMLTitleElement',
|
|
80
|
-
'HTMLBaseElement',
|
|
81
|
-
'HTMLLinkElement',
|
|
82
|
-
'HTMLMetaElement',
|
|
83
|
-
'HTMLStyleElement',
|
|
84
|
-
'HTMLBodyElement',
|
|
85
|
-
'HTMLHeadingElement',
|
|
86
|
-
'HTMLParagraphElement',
|
|
87
|
-
'HTMLHRElement',
|
|
88
|
-
'HTMLPreElement',
|
|
89
|
-
'HTMLUListElement',
|
|
90
|
-
'HTMLOListElement',
|
|
91
|
-
'HTMLLIElement',
|
|
92
|
-
'HTMLMenuElement',
|
|
93
|
-
'HTMLDListElement',
|
|
94
|
-
'HTMLDivElement',
|
|
95
|
-
'HTMLAnchorElement',
|
|
96
|
-
'HTMLAreaElement',
|
|
97
|
-
'HTMLBRElement',
|
|
98
|
-
'HTMLButtonElement',
|
|
99
|
-
'HTMLCanvasElement',
|
|
100
|
-
'HTMLDataElement',
|
|
101
|
-
'HTMLDataListElement',
|
|
102
|
-
'HTMLDetailsElement',
|
|
103
|
-
'HTMLDialogElement',
|
|
104
|
-
'HTMLDirectoryElement',
|
|
105
|
-
'HTMLFieldSetElement',
|
|
106
|
-
'HTMLFontElement',
|
|
107
|
-
'HTMLFormElement',
|
|
108
|
-
'HTMLHtmlElement',
|
|
109
|
-
'HTMLImageElement',
|
|
110
|
-
'HTMLInputElement',
|
|
111
|
-
'HTMLLabelElement',
|
|
112
|
-
'HTMLLegendElement',
|
|
113
|
-
'HTMLMapElement',
|
|
114
|
-
'HTMLMarqueeElement',
|
|
115
|
-
'HTMLMediaElement',
|
|
116
|
-
'HTMLMeterElement',
|
|
117
|
-
'HTMLModElement',
|
|
118
|
-
'HTMLOptGroupElement',
|
|
119
|
-
'HTMLOptionElement',
|
|
120
|
-
'HTMLOutputElement',
|
|
121
|
-
'HTMLPictureElement',
|
|
122
|
-
'HTMLProgressElement',
|
|
123
|
-
'HTMLQuoteElement',
|
|
124
|
-
'HTMLScriptElement',
|
|
125
|
-
'HTMLSelectElement',
|
|
126
|
-
'HTMLSlotElement',
|
|
127
|
-
'HTMLSourceElement',
|
|
128
|
-
'HTMLSpanElement',
|
|
129
|
-
'HTMLTableCaptionElement',
|
|
130
|
-
'HTMLTableCellElement',
|
|
131
|
-
'HTMLTableColElement',
|
|
132
|
-
'HTMLTableElement',
|
|
133
|
-
'HTMLTimeElement',
|
|
134
|
-
'HTMLTableRowElement',
|
|
135
|
-
'HTMLTableSectionElement',
|
|
136
|
-
'HTMLTemplateElement',
|
|
137
|
-
'HTMLTextAreaElement',
|
|
138
|
-
'HTMLUnknownElement',
|
|
139
|
-
'HTMLFrameElement',
|
|
140
|
-
'HTMLFrameSetElement',
|
|
141
|
-
'HTMLIFrameElement',
|
|
142
|
-
'HTMLEmbedElement',
|
|
143
|
-
'HTMLObjectElement',
|
|
144
|
-
'HTMLParamElement',
|
|
145
|
-
'HTMLVideoElement',
|
|
146
|
-
'HTMLAudioElement',
|
|
147
|
-
'HTMLTrackElement',
|
|
148
|
-
'HTMLFormControlsCollection',
|
|
149
|
-
'SVGElement',
|
|
150
|
-
'SVGGraphicsElement',
|
|
151
|
-
'SVGSVGElement',
|
|
152
|
-
'SVGGElement',
|
|
153
|
-
'SVGDefsElement',
|
|
154
|
-
'SVGDescElement',
|
|
155
|
-
'SVGMetadataElement',
|
|
156
|
-
'SVGTitleElement',
|
|
157
|
-
'SVGSymbolElement',
|
|
158
|
-
'SVGSwitchElement',
|
|
159
|
-
'SVGAnimatedPreserveAspectRatio',
|
|
160
|
-
'SVGAnimatedRect',
|
|
161
|
-
'SVGAnimatedString',
|
|
162
|
-
'SVGNumber',
|
|
163
|
-
'SVGPreserveAspectRatio',
|
|
164
|
-
'SVGRect',
|
|
165
|
-
'SVGStringList',
|
|
166
|
-
'Event',
|
|
167
|
-
'BeforeUnloadEvent',
|
|
168
|
-
'BlobEvent',
|
|
169
|
-
'CloseEvent',
|
|
170
|
-
'CustomEvent',
|
|
171
|
-
'MessageEvent',
|
|
172
|
-
'ErrorEvent',
|
|
173
|
-
'HashChangeEvent',
|
|
174
|
-
'PopStateEvent',
|
|
175
|
-
'StorageEvent',
|
|
176
|
-
'ProgressEvent',
|
|
177
|
-
'PageTransitionEvent',
|
|
178
|
-
'SubmitEvent',
|
|
179
|
-
'UIEvent',
|
|
180
|
-
'FocusEvent',
|
|
181
|
-
'InputEvent',
|
|
182
|
-
'MouseEvent',
|
|
183
|
-
'KeyboardEvent',
|
|
184
|
-
'TouchEvent',
|
|
185
|
-
'CompositionEvent',
|
|
186
|
-
'WheelEvent',
|
|
187
|
-
'BarProp',
|
|
188
|
-
'External',
|
|
189
|
-
'Location',
|
|
190
|
-
'History',
|
|
191
|
-
'Screen',
|
|
192
|
-
'Performance',
|
|
193
|
-
'Navigator',
|
|
194
|
-
'Crypto',
|
|
195
|
-
'PluginArray',
|
|
196
|
-
'MimeTypeArray',
|
|
197
|
-
'Plugin',
|
|
198
|
-
'MimeType',
|
|
199
|
-
'FileReader',
|
|
200
|
-
'Blob',
|
|
201
|
-
'File',
|
|
202
|
-
'FileList',
|
|
203
|
-
'ValidityState',
|
|
204
|
-
'DOMParser',
|
|
205
|
-
'XMLSerializer',
|
|
206
|
-
'FormData',
|
|
207
|
-
'XMLHttpRequestEventTarget',
|
|
208
|
-
'XMLHttpRequestUpload',
|
|
209
|
-
'XMLHttpRequest',
|
|
210
|
-
'WebSocket',
|
|
211
|
-
'NodeFilter',
|
|
212
|
-
'NodeIterator',
|
|
213
|
-
'TreeWalker',
|
|
214
|
-
'AbstractRange',
|
|
215
|
-
'Range',
|
|
216
|
-
'StaticRange',
|
|
217
|
-
'Selection',
|
|
218
|
-
'Storage',
|
|
219
|
-
'CustomElementRegistry',
|
|
220
|
-
'ElementInternals',
|
|
221
|
-
'ShadowRoot',
|
|
222
|
-
'MutationObserver',
|
|
223
|
-
'MutationRecord',
|
|
224
|
-
'Headers',
|
|
225
|
-
'AbortController',
|
|
226
|
-
'AbortSignal',
|
|
227
|
-
'Uint8Array',
|
|
228
|
-
'Uint16Array',
|
|
229
|
-
'Uint32Array',
|
|
230
|
-
'Uint8ClampedArray',
|
|
231
|
-
'Int8Array',
|
|
232
|
-
'Int16Array',
|
|
233
|
-
'Int32Array',
|
|
234
|
-
'Float32Array',
|
|
235
|
-
'Float64Array',
|
|
236
|
-
'ArrayBuffer',
|
|
237
|
-
'DeviceMotionEventAcceleration',
|
|
238
|
-
'DeviceMotionEventRotationRate',
|
|
239
|
-
'DOMRectReadOnly',
|
|
240
|
-
'DOMRect',
|
|
241
|
-
'Image',
|
|
242
|
-
'Audio',
|
|
243
|
-
'Option',
|
|
244
|
-
'CSS'
|
|
245
|
-
];
|
|
246
|
-
const OTHER_KEYS = [
|
|
247
|
-
'addEventListener',
|
|
248
|
-
'alert',
|
|
249
|
-
'blur',
|
|
250
|
-
'cancelAnimationFrame',
|
|
251
|
-
'close',
|
|
252
|
-
'confirm',
|
|
253
|
-
'createPopup',
|
|
254
|
-
'dispatchEvent',
|
|
255
|
-
'document',
|
|
256
|
-
'focus',
|
|
257
|
-
'frames',
|
|
258
|
-
'getComputedStyle',
|
|
259
|
-
'history',
|
|
260
|
-
'innerHeight',
|
|
261
|
-
'innerWidth',
|
|
262
|
-
'length',
|
|
263
|
-
'location',
|
|
264
|
-
'matchMedia',
|
|
265
|
-
'moveBy',
|
|
266
|
-
'moveTo',
|
|
267
|
-
'name',
|
|
268
|
-
'navigator',
|
|
269
|
-
'open',
|
|
270
|
-
'outerHeight',
|
|
271
|
-
'outerWidth',
|
|
272
|
-
'pageXOffset',
|
|
273
|
-
'pageYOffset',
|
|
274
|
-
'parent',
|
|
275
|
-
'postMessage',
|
|
276
|
-
'print',
|
|
277
|
-
'prompt',
|
|
278
|
-
'removeEventListener',
|
|
279
|
-
'requestAnimationFrame',
|
|
280
|
-
'resizeBy',
|
|
281
|
-
'resizeTo',
|
|
282
|
-
'screen',
|
|
283
|
-
'screenLeft',
|
|
284
|
-
'screenTop',
|
|
285
|
-
'screenX',
|
|
286
|
-
'screenY',
|
|
287
|
-
'scroll',
|
|
288
|
-
'scrollBy',
|
|
289
|
-
'scrollLeft',
|
|
290
|
-
'scrollTo',
|
|
291
|
-
'scrollTop',
|
|
292
|
-
'scrollX',
|
|
293
|
-
'scrollY',
|
|
294
|
-
'self',
|
|
295
|
-
'stop',
|
|
296
|
-
'top',
|
|
297
|
-
'Window',
|
|
298
|
-
'window'
|
|
299
|
-
];
|
|
300
|
-
const KEYS = LIVING_KEYS.concat(OTHER_KEYS);
|
|
301
|
-
const SKIP_KEYS = [
|
|
302
|
-
'window',
|
|
303
|
-
'self',
|
|
304
|
-
'top',
|
|
305
|
-
'parent'
|
|
306
|
-
];
|
|
307
|
-
function getWindowKeys(global, win, additionalKeys = []) {
|
|
308
|
-
const keysArray = [
|
|
309
|
-
...additionalKeys,
|
|
310
|
-
...KEYS
|
|
311
|
-
];
|
|
312
|
-
return new Set(keysArray.concat(Object.getOwnPropertyNames(win)).filter((k)=>{
|
|
313
|
-
if (SKIP_KEYS.includes(k)) return false;
|
|
314
|
-
if (k in global) return keysArray.includes(k);
|
|
315
|
-
return true;
|
|
316
|
-
}));
|
|
317
|
-
}
|
|
318
|
-
function isClassLike(name) {
|
|
319
|
-
return name[0] === name[0]?.toUpperCase();
|
|
320
|
-
}
|
|
321
|
-
function installGlobal(global, win, options = {}) {
|
|
322
|
-
const { bindFunctions = true } = options || {};
|
|
323
|
-
const keys = getWindowKeys(global, win, options.additionalKeys);
|
|
324
|
-
const originals = new Map();
|
|
325
|
-
const overrides = new Map();
|
|
326
|
-
for (const key of keys){
|
|
327
|
-
const boundFunction = bindFunctions && 'function' == typeof win[key] && !isClassLike(key) && win[key].bind(win);
|
|
328
|
-
if (key in global) originals.set(key, global[key]);
|
|
329
|
-
Object.defineProperty(global, key, {
|
|
330
|
-
get () {
|
|
331
|
-
if (overrides.has(key)) return overrides.get(key);
|
|
332
|
-
if (boundFunction) return boundFunction;
|
|
333
|
-
return win[key];
|
|
334
|
-
},
|
|
335
|
-
set (v) {
|
|
336
|
-
overrides.set(key, v);
|
|
337
|
-
},
|
|
338
|
-
configurable: true
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
global.window = global;
|
|
342
|
-
global.self = global;
|
|
343
|
-
global.top = global;
|
|
344
|
-
global.parent = global;
|
|
345
|
-
if (global.global) global.global = global;
|
|
346
|
-
if (global.document?.defaultView) Object.defineProperty(global.document, 'defaultView', {
|
|
347
|
-
get: ()=>global,
|
|
348
|
-
enumerable: true,
|
|
349
|
-
configurable: true
|
|
350
|
-
});
|
|
351
|
-
for (const k of SKIP_KEYS)keys.add(k);
|
|
352
|
-
return ()=>{
|
|
353
|
-
for (const key of keys)delete global[key];
|
|
354
|
-
originals.forEach((v, k)=>{
|
|
355
|
-
global[k] = v;
|
|
356
|
-
});
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
function addDefaultErrorHandler(window) {
|
|
360
|
-
let userErrorListenerCount = 0;
|
|
361
|
-
const throwUnhandledError = (e)=>{
|
|
362
|
-
if (0 === userErrorListenerCount && null != e.error) process.emit('uncaughtException', e.error);
|
|
363
|
-
};
|
|
364
|
-
const addEventListener = window.addEventListener.bind(window);
|
|
365
|
-
const removeEventListener = window.removeEventListener.bind(window);
|
|
366
|
-
window.addEventListener('error', throwUnhandledError);
|
|
367
|
-
window.addEventListener = function(...args) {
|
|
368
|
-
if ('error' === args[0]) userErrorListenerCount++;
|
|
369
|
-
return addEventListener.apply(this, args);
|
|
370
|
-
};
|
|
371
|
-
window.removeEventListener = function(...args) {
|
|
372
|
-
if ('error' === args[0] && userErrorListenerCount) userErrorListenerCount--;
|
|
373
|
-
return removeEventListener.apply(this, args);
|
|
374
|
-
};
|
|
375
|
-
return ()=>{
|
|
376
|
-
window.removeEventListener('error', throwUnhandledError);
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
35
|
}
|
|
380
36
|
};
|
|
37
|
+
export { environment };
|
package/dist/0~763.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import { __webpack_require__ } from "./runtime.js";
|
|
4
|
+
__webpack_require__.add({
|
|
5
|
+
"happy-dom": function(module) {
|
|
6
|
+
module.exports = import("happy-dom").then(function(module) {
|
|
7
|
+
return module;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
});
|