@smoothdeploy/playwright 1.58.4 → 1.60.0-beta-1780662356000
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/ThirdPartyNotices.txt +8 -5036
- package/lib/agents/agentParser.js +2 -2
- package/lib/agents/generateAgents.js +21 -22
- package/lib/agents/playwright-test-healer.agent.md +1 -0
- package/lib/agents/playwright-test-planner.agent.md +2 -1
- package/lib/cli/reportActions.js +78 -0
- package/lib/cli/testActions.js +211 -0
- package/lib/common/index.js +2898 -0
- package/lib/common/index.js.txt +35 -0
- package/lib/errorContext.js +130 -0
- package/lib/index.js +258 -206
- package/lib/{isomorphic/testServerConnection.js → isomorphic.js} +70 -35
- package/lib/isomorphic.js.txt +9 -0
- package/lib/loader/loaderProcessEntry.js +34 -0
- package/lib/loader/loaderProcessEntry.js.txt +9 -0
- package/lib/matchers/expect.js +12988 -249
- package/lib/matchers/expect.js.LICENSE +693 -0
- package/lib/matchers/expect.js.txt +72 -0
- package/lib/mcp/test/browserBackend.js +49 -22
- package/lib/mcp/test/generatorTools.js +16 -16
- package/lib/mcp/test/plannerTools.js +25 -20
- package/lib/mcp/test/seed.js +7 -7
- package/lib/mcp/test/testBackend.js +30 -30
- package/lib/mcp/test/testContext.js +50 -33
- package/lib/mcp/test/testTools.js +15 -25
- package/lib/{internalsForTest.js → package.js} +13 -8
- package/lib/program.js +63 -263
- package/lib/runner/index.js +8339 -0
- package/lib/runner/index.js.txt +60 -0
- package/lib/transform/babelBundle.js +71002 -18
- package/lib/transform/babelBundle.js.LICENSE +2359 -0
- package/lib/transform/babelBundle.js.txt +325 -0
- package/lib/transform/esmLoader.js +5884 -30
- package/lib/transform/esmLoader.js.LICENSE +335 -0
- package/lib/transform/esmLoader.js.txt +55 -0
- package/lib/util.js +37 -34
- package/lib/worker/workerProcessEntry.js +3251 -0
- package/lib/worker/workerProcessEntry.js.txt +24 -0
- package/package.json +5 -16
- package/test.mjs +1 -0
- package/types/test.d.ts +172 -12
- package/types/testReporter.d.ts +7 -5
- package/lib/common/config.js +0 -282
- package/lib/common/configLoader.js +0 -344
- package/lib/common/esmLoaderHost.js +0 -104
- package/lib/common/expectBundle.js +0 -28
- package/lib/common/expectBundleImpl.js +0 -407
- package/lib/common/fixtures.js +0 -302
- package/lib/common/ipc.js +0 -60
- package/lib/common/poolBuilder.js +0 -85
- package/lib/common/process.js +0 -132
- package/lib/common/suiteUtils.js +0 -140
- package/lib/common/test.js +0 -321
- package/lib/common/testLoader.js +0 -101
- package/lib/common/testType.js +0 -298
- package/lib/common/validators.js +0 -68
- package/lib/fsWatcher.js +0 -67
- package/lib/isomorphic/events.js +0 -77
- package/lib/isomorphic/folders.js +0 -30
- package/lib/isomorphic/stringInternPool.js +0 -69
- package/lib/isomorphic/teleReceiver.js +0 -521
- package/lib/isomorphic/teleSuiteUpdater.js +0 -157
- package/lib/isomorphic/testServerInterface.js +0 -16
- package/lib/isomorphic/testTree.js +0 -329
- package/lib/isomorphic/types.d.js +0 -16
- package/lib/loader/loaderMain.js +0 -59
- package/lib/matchers/matcherHint.js +0 -44
- package/lib/matchers/matchers.js +0 -383
- package/lib/matchers/toBeTruthy.js +0 -75
- package/lib/matchers/toEqual.js +0 -100
- package/lib/matchers/toHaveURL.js +0 -101
- package/lib/matchers/toMatchAriaSnapshot.js +0 -159
- package/lib/matchers/toMatchSnapshot.js +0 -342
- package/lib/matchers/toMatchText.js +0 -99
- package/lib/mcp/browser/browserContextFactory.js +0 -329
- package/lib/mcp/browser/browserServerBackend.js +0 -84
- package/lib/mcp/browser/config.js +0 -421
- package/lib/mcp/browser/context.js +0 -244
- package/lib/mcp/browser/response.js +0 -278
- package/lib/mcp/browser/sessionLog.js +0 -75
- package/lib/mcp/browser/tab.js +0 -343
- package/lib/mcp/browser/tools/common.js +0 -65
- package/lib/mcp/browser/tools/console.js +0 -46
- package/lib/mcp/browser/tools/dialogs.js +0 -60
- package/lib/mcp/browser/tools/evaluate.js +0 -61
- package/lib/mcp/browser/tools/files.js +0 -58
- package/lib/mcp/browser/tools/form.js +0 -63
- package/lib/mcp/browser/tools/install.js +0 -72
- package/lib/mcp/browser/tools/keyboard.js +0 -107
- package/lib/mcp/browser/tools/mouse.js +0 -107
- package/lib/mcp/browser/tools/navigate.js +0 -71
- package/lib/mcp/browser/tools/network.js +0 -63
- package/lib/mcp/browser/tools/open.js +0 -57
- package/lib/mcp/browser/tools/pdf.js +0 -49
- package/lib/mcp/browser/tools/runCode.js +0 -78
- package/lib/mcp/browser/tools/screenshot.js +0 -93
- package/lib/mcp/browser/tools/snapshot.js +0 -173
- package/lib/mcp/browser/tools/tabs.js +0 -67
- package/lib/mcp/browser/tools/tool.js +0 -47
- package/lib/mcp/browser/tools/tracing.js +0 -74
- package/lib/mcp/browser/tools/utils.js +0 -94
- package/lib/mcp/browser/tools/verify.js +0 -143
- package/lib/mcp/browser/tools/wait.js +0 -63
- package/lib/mcp/browser/tools.js +0 -84
- package/lib/mcp/browser/watchdog.js +0 -44
- package/lib/mcp/config.d.js +0 -16
- package/lib/mcp/extension/cdpRelay.js +0 -351
- package/lib/mcp/extension/extensionContextFactory.js +0 -76
- package/lib/mcp/extension/protocol.js +0 -28
- package/lib/mcp/index.js +0 -61
- package/lib/mcp/log.js +0 -35
- package/lib/mcp/program.js +0 -111
- package/lib/mcp/sdk/exports.js +0 -28
- package/lib/mcp/sdk/http.js +0 -152
- package/lib/mcp/sdk/inProcessTransport.js +0 -71
- package/lib/mcp/sdk/server.js +0 -223
- package/lib/mcp/sdk/tool.js +0 -47
- package/lib/mcp/terminal/cli.js +0 -296
- package/lib/mcp/terminal/command.js +0 -56
- package/lib/mcp/terminal/commands.js +0 -333
- package/lib/mcp/terminal/daemon.js +0 -129
- package/lib/mcp/terminal/help.json +0 -32
- package/lib/mcp/terminal/helpGenerator.js +0 -88
- package/lib/mcp/terminal/socketConnection.js +0 -80
- package/lib/plugins/gitCommitInfoPlugin.js +0 -198
- package/lib/plugins/index.js +0 -28
- package/lib/plugins/webServerPlugin.js +0 -237
- package/lib/reporters/base.js +0 -634
- package/lib/reporters/blob.js +0 -138
- package/lib/reporters/dot.js +0 -99
- package/lib/reporters/empty.js +0 -32
- package/lib/reporters/github.js +0 -128
- package/lib/reporters/html.js +0 -633
- package/lib/reporters/internalReporter.js +0 -138
- package/lib/reporters/json.js +0 -254
- package/lib/reporters/junit.js +0 -232
- package/lib/reporters/line.js +0 -131
- package/lib/reporters/list.js +0 -253
- package/lib/reporters/listModeReporter.js +0 -69
- package/lib/reporters/markdown.js +0 -144
- package/lib/reporters/merge.js +0 -558
- package/lib/reporters/multiplexer.js +0 -112
- package/lib/reporters/reporterV2.js +0 -102
- package/lib/reporters/smoothdeploy.js +0 -333
- package/lib/reporters/teleEmitter.js +0 -317
- package/lib/reporters/versions/blobV1.js +0 -16
- package/lib/runner/dispatcher.js +0 -531
- package/lib/runner/failureTracker.js +0 -72
- package/lib/runner/lastRun.js +0 -77
- package/lib/runner/loadUtils.js +0 -334
- package/lib/runner/loaderHost.js +0 -89
- package/lib/runner/processHost.js +0 -180
- package/lib/runner/projectUtils.js +0 -241
- package/lib/runner/rebase.js +0 -189
- package/lib/runner/reporters.js +0 -140
- package/lib/runner/sigIntWatcher.js +0 -96
- package/lib/runner/storage.js +0 -91
- package/lib/runner/taskRunner.js +0 -127
- package/lib/runner/tasks.js +0 -410
- package/lib/runner/testGroups.js +0 -125
- package/lib/runner/testRunner.js +0 -398
- package/lib/runner/testServer.js +0 -269
- package/lib/runner/uiModeReporter.js +0 -30
- package/lib/runner/vcs.js +0 -72
- package/lib/runner/watchMode.js +0 -396
- package/lib/runner/workerHost.js +0 -104
- package/lib/third_party/pirates.js +0 -62
- package/lib/third_party/tsconfig-loader.js +0 -103
- package/lib/transform/babelBundleImpl.js +0 -461
- package/lib/transform/compilationCache.js +0 -274
- package/lib/transform/md.js +0 -221
- package/lib/transform/portTransport.js +0 -67
- package/lib/transform/transform.js +0 -303
- package/lib/utilsBundle.js +0 -50
- package/lib/utilsBundleImpl.js +0 -103
- package/lib/worker/fixtureRunner.js +0 -262
- package/lib/worker/testInfo.js +0 -536
- package/lib/worker/testTracing.js +0 -345
- package/lib/worker/timeoutManager.js +0 -174
- package/lib/worker/util.js +0 -31
- package/lib/worker/workerMain.js +0 -530
- /package/lib/{common/globals.js → globals.js} +0 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
packages/playwright/lib/transform/esmLoader.js
|
|
2
|
+
|
|
3
|
+
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
|
4
|
+
|
|
5
|
+
The following npm packages are inlined into this bundle.
|
|
6
|
+
|
|
7
|
+
- balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match)
|
|
8
|
+
- brace-expansion@1.1.12 (https://github.com/juliangruber/brace-expansion)
|
|
9
|
+
- buffer-from@1.1.2 (https://github.com/LinusU/buffer-from)
|
|
10
|
+
- concat-map@0.0.1 (https://github.com/substack/node-concat-map)
|
|
11
|
+
- debug@4.4.3 (https://github.com/debug-js/debug)
|
|
12
|
+
- has-flag@4.0.0 (https://github.com/sindresorhus/has-flag)
|
|
13
|
+
- json5@2.2.3 (https://github.com/json5/json5)
|
|
14
|
+
- mime@3.0.0 (https://github.com/broofa/mime)
|
|
15
|
+
- minimatch@3.1.5 (https://github.com/isaacs/minimatch)
|
|
16
|
+
- ms@2.1.3 (https://github.com/vercel/ms)
|
|
17
|
+
- source-map-support@0.5.21 (https://github.com/evanw/node-source-map-support)
|
|
18
|
+
- source-map@0.6.1 (https://github.com/mozilla/source-map)
|
|
19
|
+
- supports-color@8.1.1 (https://github.com/chalk/supports-color)
|
|
20
|
+
|
|
21
|
+
%% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE
|
|
22
|
+
=========================================
|
|
23
|
+
(MIT)
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
|
26
|
+
|
|
27
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
28
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
29
|
+
the Software without restriction, including without limitation the rights to
|
|
30
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
31
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
32
|
+
so, subject to the following conditions:
|
|
33
|
+
|
|
34
|
+
The above copyright notice and this permission notice shall be included in all
|
|
35
|
+
copies or substantial portions of the Software.
|
|
36
|
+
|
|
37
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
38
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
39
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
40
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
41
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
42
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
43
|
+
SOFTWARE.
|
|
44
|
+
=========================================
|
|
45
|
+
END OF balanced-match@1.0.2 NOTICES AND INFORMATION
|
|
46
|
+
|
|
47
|
+
%% brace-expansion@1.1.12 NOTICES AND INFORMATION BEGIN HERE
|
|
48
|
+
=========================================
|
|
49
|
+
MIT License
|
|
50
|
+
|
|
51
|
+
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
|
52
|
+
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
54
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
55
|
+
in the Software without restriction, including without limitation the rights
|
|
56
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
57
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
58
|
+
furnished to do so, subject to the following conditions:
|
|
59
|
+
|
|
60
|
+
The above copyright notice and this permission notice shall be included in all
|
|
61
|
+
copies or substantial portions of the Software.
|
|
62
|
+
|
|
63
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
64
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
65
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
66
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
67
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
68
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
69
|
+
SOFTWARE.
|
|
70
|
+
=========================================
|
|
71
|
+
END OF brace-expansion@1.1.12 NOTICES AND INFORMATION
|
|
72
|
+
|
|
73
|
+
%% buffer-from@1.1.2 NOTICES AND INFORMATION BEGIN HERE
|
|
74
|
+
=========================================
|
|
75
|
+
MIT License
|
|
76
|
+
|
|
77
|
+
Copyright (c) 2016, 2018 Linus Unnebäck
|
|
78
|
+
|
|
79
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
80
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
81
|
+
in the Software without restriction, including without limitation the rights
|
|
82
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
83
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
84
|
+
furnished to do so, subject to the following conditions:
|
|
85
|
+
|
|
86
|
+
The above copyright notice and this permission notice shall be included in all
|
|
87
|
+
copies or substantial portions of the Software.
|
|
88
|
+
|
|
89
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
90
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
91
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
92
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
93
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
94
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
95
|
+
SOFTWARE.
|
|
96
|
+
=========================================
|
|
97
|
+
END OF buffer-from@1.1.2 NOTICES AND INFORMATION
|
|
98
|
+
|
|
99
|
+
%% concat-map@0.0.1 NOTICES AND INFORMATION BEGIN HERE
|
|
100
|
+
=========================================
|
|
101
|
+
This software is released under the MIT license:
|
|
102
|
+
|
|
103
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
104
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
105
|
+
the Software without restriction, including without limitation the rights to
|
|
106
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
107
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
108
|
+
subject to the following conditions:
|
|
109
|
+
|
|
110
|
+
The above copyright notice and this permission notice shall be included in all
|
|
111
|
+
copies or substantial portions of the Software.
|
|
112
|
+
|
|
113
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
114
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
115
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
116
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
117
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
118
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
119
|
+
=========================================
|
|
120
|
+
END OF concat-map@0.0.1 NOTICES AND INFORMATION
|
|
121
|
+
|
|
122
|
+
%% debug@4.4.3 NOTICES AND INFORMATION BEGIN HERE
|
|
123
|
+
=========================================
|
|
124
|
+
(The MIT License)
|
|
125
|
+
|
|
126
|
+
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
|
127
|
+
Copyright (c) 2018-2021 Josh Junon
|
|
128
|
+
|
|
129
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
130
|
+
and associated documentation files (the 'Software'), to deal in the Software without restriction,
|
|
131
|
+
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
132
|
+
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
133
|
+
subject to the following conditions:
|
|
134
|
+
|
|
135
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
136
|
+
portions of the Software.
|
|
137
|
+
|
|
138
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
139
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
140
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
141
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
142
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
143
|
+
=========================================
|
|
144
|
+
END OF debug@4.4.3 NOTICES AND INFORMATION
|
|
145
|
+
|
|
146
|
+
%% has-flag@4.0.0 NOTICES AND INFORMATION BEGIN HERE
|
|
147
|
+
=========================================
|
|
148
|
+
MIT License
|
|
149
|
+
|
|
150
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
151
|
+
|
|
152
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
153
|
+
|
|
154
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
155
|
+
|
|
156
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
157
|
+
=========================================
|
|
158
|
+
END OF has-flag@4.0.0 NOTICES AND INFORMATION
|
|
159
|
+
|
|
160
|
+
%% json5@2.2.3 NOTICES AND INFORMATION BEGIN HERE
|
|
161
|
+
=========================================
|
|
162
|
+
MIT License
|
|
163
|
+
|
|
164
|
+
Copyright (c) 2012-2018 Aseem Kishore, and [others].
|
|
165
|
+
|
|
166
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
167
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
168
|
+
in the Software without restriction, including without limitation the rights
|
|
169
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
170
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
171
|
+
furnished to do so, subject to the following conditions:
|
|
172
|
+
|
|
173
|
+
The above copyright notice and this permission notice shall be included in all
|
|
174
|
+
copies or substantial portions of the Software.
|
|
175
|
+
|
|
176
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
177
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
178
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
179
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
180
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
181
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
182
|
+
SOFTWARE.
|
|
183
|
+
|
|
184
|
+
[others]: https://github.com/json5/json5/contributors
|
|
185
|
+
=========================================
|
|
186
|
+
END OF json5@2.2.3 NOTICES AND INFORMATION
|
|
187
|
+
|
|
188
|
+
%% mime@3.0.0 NOTICES AND INFORMATION BEGIN HERE
|
|
189
|
+
=========================================
|
|
190
|
+
The MIT License (MIT)
|
|
191
|
+
|
|
192
|
+
Copyright (c) 2010 Benjamin Thomas, Robert Kieffer
|
|
193
|
+
|
|
194
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
195
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
196
|
+
in the Software without restriction, including without limitation the rights
|
|
197
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
198
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
199
|
+
furnished to do so, subject to the following conditions:
|
|
200
|
+
|
|
201
|
+
The above copyright notice and this permission notice shall be included in
|
|
202
|
+
all copies or substantial portions of the Software.
|
|
203
|
+
|
|
204
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
205
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
206
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
207
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
208
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
209
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
210
|
+
THE SOFTWARE.
|
|
211
|
+
=========================================
|
|
212
|
+
END OF mime@3.0.0 NOTICES AND INFORMATION
|
|
213
|
+
|
|
214
|
+
%% minimatch@3.1.5 NOTICES AND INFORMATION BEGIN HERE
|
|
215
|
+
=========================================
|
|
216
|
+
The ISC License
|
|
217
|
+
|
|
218
|
+
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
219
|
+
|
|
220
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
221
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
222
|
+
copyright notice and this permission notice appear in all copies.
|
|
223
|
+
|
|
224
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
225
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
226
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
227
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
228
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
229
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
230
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
231
|
+
=========================================
|
|
232
|
+
END OF minimatch@3.1.5 NOTICES AND INFORMATION
|
|
233
|
+
|
|
234
|
+
%% ms@2.1.3 NOTICES AND INFORMATION BEGIN HERE
|
|
235
|
+
=========================================
|
|
236
|
+
The MIT License (MIT)
|
|
237
|
+
|
|
238
|
+
Copyright (c) 2020 Vercel, Inc.
|
|
239
|
+
|
|
240
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
241
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
242
|
+
in the Software without restriction, including without limitation the rights
|
|
243
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
244
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
245
|
+
furnished to do so, subject to the following conditions:
|
|
246
|
+
|
|
247
|
+
The above copyright notice and this permission notice shall be included in all
|
|
248
|
+
copies or substantial portions of the Software.
|
|
249
|
+
|
|
250
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
251
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
252
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
253
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
254
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
255
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
256
|
+
SOFTWARE.
|
|
257
|
+
=========================================
|
|
258
|
+
END OF ms@2.1.3 NOTICES AND INFORMATION
|
|
259
|
+
|
|
260
|
+
%% source-map-support@0.5.21 NOTICES AND INFORMATION BEGIN HERE
|
|
261
|
+
=========================================
|
|
262
|
+
The MIT License (MIT)
|
|
263
|
+
|
|
264
|
+
Copyright (c) 2014 Evan Wallace
|
|
265
|
+
|
|
266
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
267
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
268
|
+
in the Software without restriction, including without limitation the rights
|
|
269
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
270
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
271
|
+
furnished to do so, subject to the following conditions:
|
|
272
|
+
|
|
273
|
+
The above copyright notice and this permission notice shall be included in all
|
|
274
|
+
copies or substantial portions of the Software.
|
|
275
|
+
|
|
276
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
277
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
278
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
279
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
280
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
281
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
282
|
+
SOFTWARE.
|
|
283
|
+
=========================================
|
|
284
|
+
END OF source-map-support@0.5.21 NOTICES AND INFORMATION
|
|
285
|
+
|
|
286
|
+
%% source-map@0.6.1 NOTICES AND INFORMATION BEGIN HERE
|
|
287
|
+
=========================================
|
|
288
|
+
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
|
289
|
+
All rights reserved.
|
|
290
|
+
|
|
291
|
+
Redistribution and use in source and binary forms, with or without
|
|
292
|
+
modification, are permitted provided that the following conditions are met:
|
|
293
|
+
|
|
294
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
295
|
+
list of conditions and the following disclaimer.
|
|
296
|
+
|
|
297
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
298
|
+
this list of conditions and the following disclaimer in the documentation
|
|
299
|
+
and/or other materials provided with the distribution.
|
|
300
|
+
|
|
301
|
+
* Neither the names of the Mozilla Foundation nor the names of project
|
|
302
|
+
contributors may be used to endorse or promote products derived from this
|
|
303
|
+
software without specific prior written permission.
|
|
304
|
+
|
|
305
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
306
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
307
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
308
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
309
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
310
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
311
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
312
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
313
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
314
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
315
|
+
=========================================
|
|
316
|
+
END OF source-map@0.6.1 NOTICES AND INFORMATION
|
|
317
|
+
|
|
318
|
+
%% supports-color@8.1.1 NOTICES AND INFORMATION BEGIN HERE
|
|
319
|
+
=========================================
|
|
320
|
+
MIT License
|
|
321
|
+
|
|
322
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
323
|
+
|
|
324
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
325
|
+
|
|
326
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
327
|
+
|
|
328
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
329
|
+
=========================================
|
|
330
|
+
END OF supports-color@8.1.1 NOTICES AND INFORMATION
|
|
331
|
+
|
|
332
|
+
SUMMARY
|
|
333
|
+
=========================================
|
|
334
|
+
Total Packages: 13
|
|
335
|
+
=========================================
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# packages/playwright/lib/transform/esmLoader.js
|
|
2
|
+
# total: 245.0 KB
|
|
3
|
+
|
|
4
|
+
## Inlined (46)
|
|
5
|
+
1.5 KB node_modules/balanced-match/index.js
|
|
6
|
+
4.4 KB node_modules/brace-expansion/index.js
|
|
7
|
+
1.8 KB node_modules/buffer-from/index.js
|
|
8
|
+
0.5 KB node_modules/concat-map/index.js
|
|
9
|
+
4.6 KB node_modules/debug/src/browser.js
|
|
10
|
+
5.8 KB node_modules/debug/src/common.js
|
|
11
|
+
0.3 KB node_modules/debug/src/index.js
|
|
12
|
+
4.2 KB node_modules/debug/src/node.js
|
|
13
|
+
0.4 KB node_modules/has-flag/index.js
|
|
14
|
+
0.2 KB node_modules/json5/lib/index.js
|
|
15
|
+
20.2 KB node_modules/json5/lib/parse.js
|
|
16
|
+
6.8 KB node_modules/json5/lib/stringify.js
|
|
17
|
+
15.5 KB node_modules/json5/lib/unicode.js
|
|
18
|
+
0.9 KB node_modules/json5/lib/util.js
|
|
19
|
+
0.2 KB node_modules/mime/index.js
|
|
20
|
+
2.0 KB node_modules/mime/Mime.js
|
|
21
|
+
26.8 KB node_modules/mime/types/other.js
|
|
22
|
+
10.1 KB node_modules/mime/types/standard.js
|
|
23
|
+
20.9 KB node_modules/minimatch/minimatch.js
|
|
24
|
+
2.8 KB node_modules/ms/index.js
|
|
25
|
+
16.1 KB node_modules/source-map-support/source-map-support.js
|
|
26
|
+
2.2 KB node_modules/source-map/lib/array-set.js
|
|
27
|
+
1.7 KB node_modules/source-map/lib/base64-vlq.js
|
|
28
|
+
1.1 KB node_modules/source-map/lib/base64.js
|
|
29
|
+
1.5 KB node_modules/source-map/lib/binary-search.js
|
|
30
|
+
1.3 KB node_modules/source-map/lib/mapping-list.js
|
|
31
|
+
0.9 KB node_modules/source-map/lib/quick-sort.js
|
|
32
|
+
24.0 KB node_modules/source-map/lib/source-map-consumer.js
|
|
33
|
+
10.6 KB node_modules/source-map/lib/source-map-generator.js
|
|
34
|
+
9.6 KB node_modules/source-map/lib/source-node.js
|
|
35
|
+
8.6 KB node_modules/source-map/lib/util.js
|
|
36
|
+
0.3 KB node_modules/source-map/source-map.js
|
|
37
|
+
3.4 KB node_modules/supports-color/index.js
|
|
38
|
+
0.1 KB packages/isomorphic/rtti.ts
|
|
39
|
+
0.2 KB packages/isomorphic/stackTrace.ts
|
|
40
|
+
0.2 KB packages/isomorphic/stringUtils.ts
|
|
41
|
+
6.3 KB packages/playwright/src/transform/compilationCache.ts
|
|
42
|
+
3.1 KB packages/playwright/src/transform/esmLoader.ts
|
|
43
|
+
1.1 KB packages/playwright/src/transform/pirates.ts
|
|
44
|
+
1.1 KB packages/playwright/src/transform/portTransport.ts
|
|
45
|
+
9.7 KB packages/playwright/src/transform/transform.ts
|
|
46
|
+
2.9 KB packages/playwright/src/transform/tsconfig-loader.ts
|
|
47
|
+
4.6 KB packages/playwright/src/util.ts
|
|
48
|
+
0.2 KB packages/utils/crypto.ts
|
|
49
|
+
0.2 KB packages/utils/debug.ts
|
|
50
|
+
0.5 KB packages/utils/env.ts
|
|
51
|
+
|
|
52
|
+
## External (3)
|
|
53
|
+
../globals
|
|
54
|
+
../package
|
|
55
|
+
playwright-core/package.json
|
package/lib/util.js
CHANGED
|
@@ -29,10 +29,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var util_exports = {};
|
|
30
30
|
__export(util_exports, {
|
|
31
31
|
addSuffixToFilePath: () => addSuffixToFilePath,
|
|
32
|
-
ansiRegex: () =>
|
|
33
|
-
createFileFiltersFromArguments: () => createFileFiltersFromArguments,
|
|
32
|
+
ansiRegex: () => ansiRegex,
|
|
34
33
|
createFileMatcher: () => createFileMatcher,
|
|
35
|
-
createFileMatcherFromArguments: () => createFileMatcherFromArguments,
|
|
36
34
|
createTitleMatcher: () => createTitleMatcher,
|
|
37
35
|
debugTest: () => debugTest,
|
|
38
36
|
errorWithFile: () => errorWithFile,
|
|
@@ -55,7 +53,8 @@ __export(util_exports, {
|
|
|
55
53
|
resolveReporterOutputPath: () => resolveReporterOutputPath,
|
|
56
54
|
sanitizeFilePathBeforeExtension: () => sanitizeFilePathBeforeExtension,
|
|
57
55
|
serializeError: () => serializeError,
|
|
58
|
-
stripAnsiEscapes: () =>
|
|
56
|
+
stripAnsiEscapes: () => stripAnsiEscapes,
|
|
57
|
+
takeFirst: () => takeFirst,
|
|
59
58
|
trimLongString: () => trimLongString,
|
|
60
59
|
windowsFilesystemFriendlyLength: () => windowsFilesystemFriendlyLength
|
|
61
60
|
});
|
|
@@ -64,9 +63,14 @@ var import_fs = __toESM(require("fs"));
|
|
|
64
63
|
var import_path = __toESM(require("path"));
|
|
65
64
|
var import_url = __toESM(require("url"));
|
|
66
65
|
var import_util = __toESM(require("util"));
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
const debug = require("playwright-core/lib/utilsBundle").debug;
|
|
67
|
+
const mime = require("playwright-core/lib/utilsBundle").mime;
|
|
68
|
+
const minimatch = require("playwright-core/lib/utilsBundle").minimatch;
|
|
69
|
+
const { calculateSha1 } = require("playwright-core/lib/coreBundle").utils;
|
|
70
|
+
const { sanitizeForFilePath } = require("playwright-core/lib/coreBundle").utils;
|
|
71
|
+
const { isRegExp } = require("playwright-core/lib/coreBundle").iso;
|
|
72
|
+
const { parseStackFrame, stringifyStackFrames } = require("playwright-core/lib/coreBundle").iso;
|
|
73
|
+
const { ansiRegex, isString, stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
|
|
70
74
|
const PLAYWRIGHT_TEST_PATH = import_path.default.join(__dirname, "..");
|
|
71
75
|
const PLAYWRIGHT_CORE_PATH = import_path.default.dirname(require.resolve("playwright-core/package.json"));
|
|
72
76
|
function filterStackTrace(e) {
|
|
@@ -74,7 +78,7 @@ function filterStackTrace(e) {
|
|
|
74
78
|
const cause = e.cause instanceof Error ? filterStackTrace(e.cause) : void 0;
|
|
75
79
|
if (process.env.PWDEBUGIMPL)
|
|
76
80
|
return { message: name + e.message, stack: e.stack || "", cause };
|
|
77
|
-
const stackLines =
|
|
81
|
+
const stackLines = stringifyStackFrames(filteredStackTrace(e.stack?.split("\n") || []));
|
|
78
82
|
return {
|
|
79
83
|
message: name + e.message,
|
|
80
84
|
stack: `${name}${e.message}${stackLines.map((line) => "\n" + line).join("")}`,
|
|
@@ -82,16 +86,18 @@ function filterStackTrace(e) {
|
|
|
82
86
|
};
|
|
83
87
|
}
|
|
84
88
|
function filterStackFile(file) {
|
|
85
|
-
if (
|
|
89
|
+
if (process.env.PWDEBUGIMPL)
|
|
90
|
+
return true;
|
|
91
|
+
if (file.startsWith(PLAYWRIGHT_TEST_PATH))
|
|
86
92
|
return false;
|
|
87
|
-
if (
|
|
93
|
+
if (file.startsWith(PLAYWRIGHT_CORE_PATH))
|
|
88
94
|
return false;
|
|
89
95
|
return true;
|
|
90
96
|
}
|
|
91
97
|
function filteredStackTrace(rawStack) {
|
|
92
98
|
const frames = [];
|
|
93
99
|
for (const line of rawStack) {
|
|
94
|
-
const frame =
|
|
100
|
+
const frame = parseStackFrame(line, import_path.default.sep, !!process.env.PWDEBUGIMPL);
|
|
95
101
|
if (!frame || !frame.file)
|
|
96
102
|
continue;
|
|
97
103
|
if (!filterStackFile(frame.file))
|
|
@@ -115,21 +121,11 @@ function parseLocationArg(arg) {
|
|
|
115
121
|
column: match?.[3] ? parseInt(match[3], 10) : null
|
|
116
122
|
};
|
|
117
123
|
}
|
|
118
|
-
function createFileFiltersFromArguments(args) {
|
|
119
|
-
return args.map((arg) => {
|
|
120
|
-
const parsed = parseLocationArg(arg);
|
|
121
|
-
return { re: forceRegExp(parsed.file), line: parsed.line, column: parsed.column };
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
function createFileMatcherFromArguments(args) {
|
|
125
|
-
const filters = createFileFiltersFromArguments(args);
|
|
126
|
-
return createFileMatcher(filters.map((filter) => filter.re || filter.exact || ""));
|
|
127
|
-
}
|
|
128
124
|
function createFileMatcher(patterns) {
|
|
129
125
|
const reList = [];
|
|
130
126
|
const filePatterns = [];
|
|
131
127
|
for (const pattern of Array.isArray(patterns) ? patterns : [patterns]) {
|
|
132
|
-
if (
|
|
128
|
+
if (isRegExp(pattern)) {
|
|
133
129
|
reList.push(pattern);
|
|
134
130
|
} else {
|
|
135
131
|
if (!pattern.startsWith("**/"))
|
|
@@ -153,7 +149,7 @@ function createFileMatcher(patterns) {
|
|
|
153
149
|
}
|
|
154
150
|
}
|
|
155
151
|
for (const pattern of filePatterns) {
|
|
156
|
-
if (
|
|
152
|
+
if (minimatch(filePath, pattern, { nocase: true, dot: true }))
|
|
157
153
|
return true;
|
|
158
154
|
}
|
|
159
155
|
return false;
|
|
@@ -198,18 +194,19 @@ function errorWithFile(file, message) {
|
|
|
198
194
|
return new Error(`${relativeFilePath(file)}: ${message}`);
|
|
199
195
|
}
|
|
200
196
|
function expectTypes(receiver, types, matcherName) {
|
|
201
|
-
if (typeof receiver !== "object" || !types.includes(receiver.
|
|
197
|
+
if (typeof receiver !== "object" || !types.includes(receiver._apiName)) {
|
|
198
|
+
const receiverString = typeof receiver === "object" && receiver !== null ? `${receiver.constructor.name} ${import_util.default.inspect(receiver)}` : String(receiver);
|
|
202
199
|
const commaSeparated = types.slice();
|
|
203
200
|
const lastType = commaSeparated.pop();
|
|
204
201
|
const typesString = commaSeparated.length ? commaSeparated.join(", ") + " or " + lastType : lastType;
|
|
205
|
-
throw new Error(`${matcherName} can be only used with ${typesString} object${types.length > 1 ? "s" : ""}`);
|
|
202
|
+
throw new Error(`${matcherName} can be only used with ${typesString} object${types.length > 1 ? "s" : ""}, was called with ${receiverString}`);
|
|
206
203
|
}
|
|
207
204
|
}
|
|
208
205
|
const windowsFilesystemFriendlyLength = 60;
|
|
209
206
|
function trimLongString(s, length = 100) {
|
|
210
207
|
if (s.length <= length)
|
|
211
208
|
return s;
|
|
212
|
-
const hash =
|
|
209
|
+
const hash = calculateSha1(s);
|
|
213
210
|
const middle = `-${hash.substring(0, 5)}-`;
|
|
214
211
|
const start = Math.floor((length - middle.length) / 2);
|
|
215
212
|
const end = length - middle.length - start;
|
|
@@ -223,7 +220,7 @@ function addSuffixToFilePath(filePath, suffix) {
|
|
|
223
220
|
function sanitizeFilePathBeforeExtension(filePath, ext) {
|
|
224
221
|
ext ??= import_path.default.extname(filePath);
|
|
225
222
|
const base = filePath.substring(0, filePath.length - ext.length);
|
|
226
|
-
return
|
|
223
|
+
return sanitizeForFilePath(base) + ext;
|
|
227
224
|
}
|
|
228
225
|
function getContainedPath(parentPath, subPath = "") {
|
|
229
226
|
const resolvedPath = import_path.default.resolve(parentPath, subPath);
|
|
@@ -231,7 +228,7 @@ function getContainedPath(parentPath, subPath = "") {
|
|
|
231
228
|
return resolvedPath;
|
|
232
229
|
return null;
|
|
233
230
|
}
|
|
234
|
-
const debugTest =
|
|
231
|
+
const debugTest = debug("pw:test");
|
|
235
232
|
const folderToPackageJsonPath = /* @__PURE__ */ new Map();
|
|
236
233
|
function getPackageJsonPath(folderPath) {
|
|
237
234
|
const cached = folderToPackageJsonPath.get(folderPath);
|
|
@@ -264,14 +261,14 @@ async function normalizeAndSaveAttachment(outputPath, name, options = {}) {
|
|
|
264
261
|
if ((options.path !== void 0 ? 1 : 0) + (options.body !== void 0 ? 1 : 0) !== 1)
|
|
265
262
|
throw new Error(`Exactly one of "path" and "body" must be specified`);
|
|
266
263
|
if (options.path !== void 0) {
|
|
267
|
-
const hash =
|
|
268
|
-
if (!
|
|
264
|
+
const hash = calculateSha1(options.path);
|
|
265
|
+
if (!isString(name))
|
|
269
266
|
throw new Error('"name" should be string.');
|
|
270
|
-
const sanitizedNamePrefix =
|
|
267
|
+
const sanitizedNamePrefix = sanitizeForFilePath(name) + "-";
|
|
271
268
|
const dest = import_path.default.join(outputPath, "attachments", sanitizedNamePrefix + hash + import_path.default.extname(options.path));
|
|
272
269
|
await import_fs.default.promises.mkdir(import_path.default.dirname(dest), { recursive: true });
|
|
273
270
|
await import_fs.default.promises.copyFile(options.path, dest);
|
|
274
|
-
const contentType = options.contentType ?? (
|
|
271
|
+
const contentType = options.contentType ?? (mime.getType(import_path.default.basename(options.path)) || "application/octet-stream");
|
|
275
272
|
return { name, contentType, path: dest };
|
|
276
273
|
} else {
|
|
277
274
|
const contentType = options.contentType ?? (typeof options.body === "string" ? "text/plain" : "application/octet-stream");
|
|
@@ -365,13 +362,18 @@ async function removeDirAndLogToConsole(dir) {
|
|
|
365
362
|
} catch {
|
|
366
363
|
}
|
|
367
364
|
}
|
|
365
|
+
function takeFirst(...args) {
|
|
366
|
+
for (const arg of args) {
|
|
367
|
+
if (arg !== void 0)
|
|
368
|
+
return arg;
|
|
369
|
+
}
|
|
370
|
+
return void 0;
|
|
371
|
+
}
|
|
368
372
|
// Annotate the CommonJS export names for ESM import in node:
|
|
369
373
|
0 && (module.exports = {
|
|
370
374
|
addSuffixToFilePath,
|
|
371
375
|
ansiRegex,
|
|
372
|
-
createFileFiltersFromArguments,
|
|
373
376
|
createFileMatcher,
|
|
374
|
-
createFileMatcherFromArguments,
|
|
375
377
|
createTitleMatcher,
|
|
376
378
|
debugTest,
|
|
377
379
|
errorWithFile,
|
|
@@ -395,6 +397,7 @@ async function removeDirAndLogToConsole(dir) {
|
|
|
395
397
|
sanitizeFilePathBeforeExtension,
|
|
396
398
|
serializeError,
|
|
397
399
|
stripAnsiEscapes,
|
|
400
|
+
takeFirst,
|
|
398
401
|
trimLongString,
|
|
399
402
|
windowsFilesystemFriendlyLength
|
|
400
403
|
});
|