1
1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
3
- exports [` allows exponent operator 1` ] = `
3
+ exports [` runtimeVersion 1 > allows exponent operator 1` ] = `
4
4
"
5
5
var foo = 2 ** 2;
6
6
console.log(foo);
7
7
"
8
8
` ;
9
9
10
- exports [` allows template strings 1` ] = `
10
+ exports [` runtimeVersion 1 > allows template strings 1` ] = `
11
11
"
12
12
var foo = \` Hello\` ;
13
13
var bar = \`\$ { foo } \` ;
14
14
"
15
15
` ;
16
16
17
- exports [` arrays > does not modify supported functions 1` ] = `
17
+ exports [` runtimeVersion 1 > arrays > does not modify supported functions 1` ] = `
18
18
"
19
19
var foo = Array.of(1, 2, 3);
20
20
var foo = [].copyWithin(10, 0, 2);
@@ -25,7 +25,7 @@ var foo = [].includes("1");
25
25
"
26
26
` ;
27
27
28
- exports [` arrays > does not modify supported typed arrays 1` ] = `
28
+ exports [` runtimeVersion 1 > arrays > does not modify supported typed arrays 1` ] = `
29
29
"
30
30
var foo = new Int8Array([1, 2, 3]);
31
31
var foo = new Uint8Array([1, 2, 3]);
@@ -47,14 +47,14 @@ var foo = new Float64Array([1, 2, 3]).toString();
47
47
"
48
48
` ;
49
49
50
- exports [` const, let, var > lets vars through 1` ] = `
50
+ exports [` runtimeVersion 1 > const, let, var > lets vars through 1` ] = `
51
51
"
52
52
var foo = "bar";
53
53
console.log(foo);
54
54
"
55
55
` ;
56
56
57
- exports [` does not modify crypto imports 1` ] = `
57
+ exports [` runtimeVersion 1 > does not modify crypto imports 1` ] = `
58
58
"
59
59
import crypto from "crypto";
60
60
var hash = crypto.createHash("sha1");
@@ -63,14 +63,14 @@ hash.digest("base64");
63
63
"
64
64
` ;
65
65
66
- exports [` does not modify named capture groups 1` ] = `
66
+ exports [` runtimeVersion 1 > does not modify named capture groups 1` ] = `
67
67
"
68
68
var regex = /(?<foo >.*+)/;
69
69
var matches = regex.exec("Hello world");
70
70
"
71
71
`;
72
72
73
- exports[`does not modify supported functions 1`] = `
73
+ exports[`runtimeVersion 1 > does not modify supported functions 1`] = `
74
74
"
75
75
var foo = String.fromCodePoint(12);
76
76
var foo = "bar".codePointAt(0);
@@ -85,7 +85,7 @@ var foo = "bar".trimEnd();
85
85
"
86
86
`;
87
87
88
- exports[`does not modify supported functions 2`] = `
88
+ exports[`runtimeVersion 1 > does not modify supported functions 2`] = `
89
89
"
90
90
var foo = Number.isFinite(10);
91
91
var foo = Number.isInteger(10);
@@ -107,7 +107,7 @@ var foo = 10 .toPrecision(10);
107
107
"
108
108
`;
109
109
110
- exports[`does not modify supported functions 3`] = `
110
+ exports[`runtimeVersion 1 > does not modify supported functions 3`] = `
111
111
"
112
112
new Promise((resolve, reject) => resolve());
113
113
new Promise((resolve, reject) => reject());
@@ -117,7 +117,7 @@ new Promise((resolve, reject) => reject()).finally(console.log);
117
117
"
118
118
`;
119
119
120
- exports[`functions > allows arrow functions 1`] = `
120
+ exports[`runtimeVersion 1 > functions > allows arrow functions 1`] = `
121
121
"
122
122
var foo = () => {
123
123
return true ;
@@ -126,7 +126,7 @@ console.log(foo());
126
126
"
127
127
`;
128
128
129
- exports[`functions > allows spread parameters 1`] = `
129
+ exports[`runtimeVersion 1 > functions > allows spread parameters 1`] = `
130
130
"
131
131
var foo = (...rest) => {
132
132
return rest [0 ];
@@ -135,7 +135,216 @@ console.log(foo("test"));
135
135
"
136
136
`;
137
137
138
- exports[`minification does not rename handler function 1`] = `
138
+ exports[`runtimeVersion 1 > minification does not rename handler function 1`] = `
139
+ "
140
+ function handler(event){ console .log (" test" )}
141
+ "
142
+ `;
143
+
144
+ exports[`runtimeVersion 2 > allows await/async 1`] = `
145
+ "
146
+ void (async () => {
147
+ var func = async () => true ;
148
+ var result = await func ();
149
+ } )();
150
+ "
151
+ `;
152
+
153
+ exports[`runtimeVersion 2 > allows exponent operator 1`] = `
154
+ "
155
+ var foo = 2 ** 2;
156
+ console.log(foo);
157
+ "
158
+ `;
159
+
160
+ exports[`runtimeVersion 2 > allows template strings 1`] = `
161
+ "
162
+ var foo = \`Hello\`;
163
+ var bar = \`\${ foo } \`;
164
+ "
165
+ `;
166
+
167
+ exports[`runtimeVersion 2 > arrays > does not modify supported functions 1`] = `
168
+ "
169
+ var foo = Array.of(1, 2, 3);
170
+ var foo = [].copyWithin(10, 0, 2);
171
+ var foo = [].fill("foo", 0, 20);
172
+ var foo = [].find(() => true);
173
+ var foo = [].findIndex(() => true);
174
+ var foo = [].includes("1");
175
+ "
176
+ `;
177
+
178
+ exports[`runtimeVersion 2 > arrays > does not modify supported typed arrays 1`] = `
179
+ "
180
+ var foo = new Int8Array([1, 2, 3]);
181
+ var foo = new Uint8Array([1, 2, 3]);
182
+ var foo = new Uint8ClampedArray([1, 2, 3]);
183
+ var foo = new Int16Array([1, 2, 3]);
184
+ var foo = new Uint16Array([1, 2, 3]);
185
+ var foo = new Int32Array([1, 2, 3]);
186
+ var foo = new Uint32Array([1, 2, 3]);
187
+ var foo = new Float32Array([1, 2, 3]);
188
+ var foo = new Float64Array([1, 2, 3]);
189
+ var foo = new Float64Array([1, 2, 3]);
190
+ var foo = new Float64Array([1, 2, 3]).copyWithin(10, 0, 2);
191
+ var foo = new Float64Array([1, 2, 3]).fill(1, 20);
192
+ var foo = new Float64Array([1, 2, 3]).join("\\n");
193
+ new Float64Array([1, 2, 3]).set([1, 2, 3]);
194
+ var foo = new Float64Array([1, 2, 3]).slice(0, 1);
195
+ var foo = new Float64Array([1, 2, 3]).subarray(0, 1);
196
+ var foo = new Float64Array([1, 2, 3]).toString();
197
+ "
198
+ `;
199
+
200
+ exports[`runtimeVersion 2 > const, let, var > lets const through 1`] = `
201
+ "
202
+ const foo = "bar";
203
+ console.log(foo);
204
+ "
205
+ `;
206
+
207
+ exports[`runtimeVersion 2 > const, let, var > lets let through 1`] = `
208
+ "
209
+ let foo = "bar";
210
+ console.log(foo);
211
+ "
212
+ `;
213
+
214
+ exports[`runtimeVersion 2 > const, let, var > lets vars through 1`] = `
215
+ "
216
+ var foo = "bar";
217
+ console.log(foo);
218
+ "
219
+ `;
220
+
221
+ exports[`runtimeVersion 2 > does not atob and btoa 1`] = `
222
+ "
223
+ atob(btao("Hello World"));
224
+ "
225
+ `;
226
+
227
+ exports[`runtimeVersion 2 > does not atob and btoa functions 1`] = `
228
+ "
229
+ atob(btao("Hello World"));
230
+ "
231
+ `;
232
+
233
+ exports[`runtimeVersion 2 > does not modify atob and btoa functions 1`] = `
234
+ "
235
+ atob(btao("Hello World"));
236
+ "
237
+ `;
238
+
239
+ exports[`runtimeVersion 2 > does not modify buffer imports 1`] = `
240
+ "
241
+ import buffer from "buffer";
242
+ var b = buffer.from("aString", "utf8");
243
+ b.toString("utf8");
244
+ "
245
+ `;
246
+
247
+ exports[`runtimeVersion 2 > does not modify buffer imports 2`] = `
248
+ "
249
+ import buffer from "buffer";
250
+ var b = buffer.from("aString", "utf8");
251
+ b.toString("utf8");
252
+ "
253
+ `;
254
+
255
+ exports[`runtimeVersion 2 > does not modify crypto imports 1`] = `
256
+ "
257
+ import crypto from "crypto";
258
+ var hash = crypto.createHash("sha1");
259
+ hash.update("data");
260
+ hash.digest("base64");
261
+ "
262
+ `;
263
+
264
+ exports[`runtimeVersion 2 > does not modify named capture groups 1`] = `
265
+ "
266
+ var regex = /(?<foo >.*+)/;
267
+ var matches = regex.exec("Hello world");
268
+ "
269
+ `;
270
+
271
+ exports[`runtimeVersion 2 > does not modify supported Promise functions 1`] = `
272
+ "
273
+ new Promise((resolve, reject) => resolve());
274
+ new Promise((resolve, reject) => reject());
275
+ new Promise((resolve, reject) => reject()).catch(console.log);
276
+ new Promise((resolve, reject) => reject()).then(console.log);
277
+ new Promise((resolve, reject) => reject()).finally(console.log);
278
+ Promise.all([new Promise((resolve, reject) => resolve())]);
279
+ "
280
+ `;
281
+
282
+ exports[`runtimeVersion 2 > does not modify supported functions 1`] = `
283
+ "
284
+ var foo = String.fromCodePoint(12);
285
+ var foo = "bar".codePointAt(0);
286
+ var foo = "bar".includes("ar");
287
+ var foo = "bar".startsWith("ba");
288
+ var foo = "bar".endsWith("ar");
289
+ var foo = "bar".repeat(2);
290
+ var foo = "bar".padStart(10);
291
+ var foo = "bar".padEnd(10);
292
+ var foo = "bar".trimStart();
293
+ var foo = "bar".trimEnd();
294
+ "
295
+ `;
296
+
297
+ exports[`runtimeVersion 2 > does not modify supported functions 2`] = `
298
+ "
299
+ var foo = Number.isFinite(10);
300
+ var foo = Number.isInteger(10);
301
+ var foo = Number.isNaN(10);
302
+ var foo = Number.isSafeInteger(10);
303
+ var foo = Number.parseFloat("10.0");
304
+ var foo = Number.parseInt("10");
305
+ var foo = Number.EPSILON;
306
+ var foo = Number.MAX_SAFE_INTEGER;
307
+ var foo = Number.MAX_VALUE;
308
+ var foo = Number.MIN_SAFE_INTEGER;
309
+ var foo = Number.MIN_VALUE;
310
+ var foo = Number.NEGATIVE_INFINITY;
311
+ var foo = Number.NaN;
312
+ var foo = Number.POSITIVE_INFINITY;
313
+ var foo = 10 .toExponential();
314
+ var foo = 10 .toFixed();
315
+ var foo = 10 .toPrecision(10);
316
+ "
317
+ `;
318
+
319
+ exports[`runtimeVersion 2 > does not modify supported functions 3`] = `
320
+ "
321
+ new Promise((resolve, reject) => resolve());
322
+ new Promise((resolve, reject) => reject());
323
+ new Promise((resolve, reject) => reject()).catch(console.log);
324
+ new Promise((resolve, reject) => reject()).then(console.log);
325
+ new Promise((resolve, reject) => reject()).finally(console.log);
326
+ "
327
+ `;
328
+
329
+ exports[`runtimeVersion 2 > functions > allows arrow functions 1`] = `
330
+ "
331
+ var foo = () => {
332
+ return true ;
333
+ } ;
334
+ console.log(foo());
335
+ "
336
+ `;
337
+
338
+ exports[`runtimeVersion 2 > functions > allows spread parameters 1`] = `
339
+ "
340
+ var foo = (...rest) => {
341
+ return rest [0 ];
342
+ } ;
343
+ console.log(foo("test"));
344
+ "
345
+ `;
346
+
347
+ exports[`runtimeVersion 2 > minification does not rename handler function 1`] = `
139
348
"
140
349
function handler(event){ console .log (" test" )}
141
350
"
0 commit comments