@rstest/core 0.9.5 → 0.9.6
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 +80 -0
- package/dist/0~8843.js +9 -1
- package/dist/{0~lib.js → 0~@babel/code-frame.js} +2 -2
- package/dist/0~@clack/prompts.js +1044 -0
- package/dist/0~browserLoader.js +1 -1
- package/dist/0~browser~1.js +17 -17
- package/dist/0~checkThresholds.js +1 -1
- package/dist/0~chokidar.js +43 -42
- package/dist/0~fake-timers.js +173 -70
- package/dist/0~generate.js +1 -2
- package/dist/0~magic-string.es.js +1 -181
- package/dist/0~restart.js +1 -1
- package/dist/0~snapshot.js +1 -1
- package/dist/1255.js +11 -11
- package/dist/3145.js +102 -9
- package/dist/4411.js +13 -13
- package/dist/6830.js +1 -1
- package/dist/6887.js +15 -0
- package/dist/9743.js +1 -1
- package/dist/9784.js +2 -2
- package/dist/browser-runtime/2~fake-timers.js +172 -65
- package/dist/browser-runtime/2~magic-string.es.js +3 -189
- package/dist/browser-runtime/2~snapshot.js +2 -2
- package/dist/browser-runtime/723.js +70 -2
- package/dist/browser-runtime/index.d.ts +16 -5
- package/dist/browser.d.ts +16 -5
- package/dist/globalSetupWorker.js +1 -1
- package/dist/index.d.ts +39 -11
- package/dist/index.js +1 -1
- package/dist/worker.d.ts +16 -5
- package/dist/worker.js +1 -1
- package/package.json +11 -11
- package/dist/0~dist.js +0 -1014
- package/dist/4899.js +0 -11
- package/dist/browser-runtime/rslib-runtime.js +0 -49
- /package/dist/{rslib-runtime.js → 0~rslib-runtime.js} +0 -0
package/dist/0~fake-timers.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import "./4899.js";
|
|
2
|
+
import { __webpack_require__ } from "./0~rslib-runtime.js";
|
|
3
|
+
import "./6887.js";
|
|
5
4
|
__webpack_require__.add({
|
|
6
5
|
"../../node_modules/.pnpm/@sinonjs+commons@3.0.1/node_modules/@sinonjs/commons/lib/called-in-order.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
7
6
|
var every = __webpack_require__("../../node_modules/.pnpm/@sinonjs+commons@3.0.1/node_modules/@sinonjs/commons/lib/prototypes/array.js").every;
|
|
@@ -184,7 +183,7 @@ __webpack_require__.add({
|
|
|
184
183
|
}
|
|
185
184
|
module.exports = valueToString;
|
|
186
185
|
},
|
|
187
|
-
"../../node_modules/.pnpm/@sinonjs+fake-timers@15.
|
|
186
|
+
"../../node_modules/.pnpm/@sinonjs+fake-timers@15.2.0/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
188
187
|
const globalObject = __webpack_require__("../../node_modules/.pnpm/@sinonjs+commons@3.0.1/node_modules/@sinonjs/commons/lib/index.js").global;
|
|
189
188
|
let timersModule, timersPromisesModule;
|
|
190
189
|
try {
|
|
@@ -217,11 +216,11 @@ __webpack_require__.add({
|
|
|
217
216
|
isPresent.performance = _global.performance && "function" == typeof _global.performance.now;
|
|
218
217
|
const hasPerformancePrototype = _global.Performance && (typeof _global.Performance).match(/^(function|object)$/);
|
|
219
218
|
const hasPerformanceConstructorPrototype = _global.performance && _global.performance.constructor && _global.performance.constructor.prototype;
|
|
220
|
-
isPresent.queueMicrotask =
|
|
219
|
+
isPresent.queueMicrotask = Object.prototype.hasOwnProperty.call(_global, "queueMicrotask");
|
|
221
220
|
isPresent.requestAnimationFrame = _global.requestAnimationFrame && "function" == typeof _global.requestAnimationFrame;
|
|
222
221
|
isPresent.cancelAnimationFrame = _global.cancelAnimationFrame && "function" == typeof _global.cancelAnimationFrame;
|
|
223
222
|
isPresent.requestIdleCallback = _global.requestIdleCallback && "function" == typeof _global.requestIdleCallback;
|
|
224
|
-
isPresent.
|
|
223
|
+
isPresent.cancelIdleCallback = _global.cancelIdleCallback && "function" == typeof _global.cancelIdleCallback;
|
|
225
224
|
isPresent.setImmediate = _global.setImmediate && "function" == typeof _global.setImmediate;
|
|
226
225
|
isPresent.clearImmediate = _global.clearImmediate && "function" == typeof _global.clearImmediate;
|
|
227
226
|
isPresent.Intl = _global.Intl && "object" == typeof _global.Intl;
|
|
@@ -229,6 +228,7 @@ __webpack_require__.add({
|
|
|
229
228
|
const NativeDate = _global.Date;
|
|
230
229
|
const NativeIntl = isPresent.Intl ? Object.defineProperties(Object.create(null), Object.getOwnPropertyDescriptors(_global.Intl)) : void 0;
|
|
231
230
|
let uniqueTimerId = idCounterStart;
|
|
231
|
+
let uniqueTimerOrder = 0;
|
|
232
232
|
if (void 0 === NativeDate) throw new Error("The global scope doesn't have a `Date` object (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)");
|
|
233
233
|
isPresent.Date = true;
|
|
234
234
|
class FakePerformanceEntry {
|
|
@@ -389,52 +389,63 @@ __webpack_require__.add({
|
|
|
389
389
|
}
|
|
390
390
|
function addTimer(clock, timer) {
|
|
391
391
|
if (void 0 === timer.func) throw new Error("Callback must be provided to timer calls");
|
|
392
|
-
if (
|
|
393
|
-
if ("function" != typeof timer.func) throw new TypeError(`[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${timer.func} of type ${typeof timer.func}`);
|
|
394
|
-
}
|
|
392
|
+
if ("function" != typeof timer.func) throw new TypeError(`[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${timer.func} of type ${typeof timer.func}`);
|
|
395
393
|
if (isNearInfiniteLimit) timer.error = new Error();
|
|
396
394
|
timer.type = timer.immediate ? "Immediate" : "Timeout";
|
|
397
|
-
if (
|
|
395
|
+
if (Object.prototype.hasOwnProperty.call(timer, "delay")) {
|
|
398
396
|
if ("number" != typeof timer.delay) timer.delay = parseInt(timer.delay, 10);
|
|
399
397
|
if (!isNumberFinite(timer.delay)) timer.delay = 0;
|
|
400
398
|
timer.delay = timer.delay > maxTimeout ? 1 : timer.delay;
|
|
401
399
|
timer.delay = Math.max(0, timer.delay);
|
|
402
400
|
}
|
|
403
|
-
if (
|
|
401
|
+
if (Object.prototype.hasOwnProperty.call(timer, "interval")) {
|
|
404
402
|
timer.type = "Interval";
|
|
405
403
|
timer.interval = timer.interval > maxTimeout ? 1 : timer.interval;
|
|
406
404
|
}
|
|
407
|
-
if (
|
|
405
|
+
if (Object.prototype.hasOwnProperty.call(timer, "animation")) {
|
|
408
406
|
timer.type = "AnimationFrame";
|
|
409
407
|
timer.animation = true;
|
|
410
408
|
}
|
|
411
|
-
if (
|
|
412
|
-
timer.type = "IdleCallback";
|
|
413
|
-
timer.
|
|
409
|
+
if (Object.prototype.hasOwnProperty.call(timer, "requestIdleCallback")) {
|
|
410
|
+
if (!timer.delay) timer.type = "IdleCallback";
|
|
411
|
+
timer.requestIdleCallback = true;
|
|
412
|
+
}
|
|
413
|
+
if (!clock.timers) {
|
|
414
|
+
clock.timers = {};
|
|
415
|
+
clock.timerHeap = new TimerHeap();
|
|
416
|
+
}
|
|
417
|
+
while(clock.timers && clock.timers[uniqueTimerId]){
|
|
418
|
+
uniqueTimerId++;
|
|
419
|
+
if (uniqueTimerId >= Number.MAX_SAFE_INTEGER) uniqueTimerId = idCounterStart;
|
|
414
420
|
}
|
|
415
|
-
if (!clock.timers) clock.timers = {};
|
|
416
421
|
timer.id = uniqueTimerId++;
|
|
422
|
+
if (uniqueTimerId >= Number.MAX_SAFE_INTEGER) uniqueTimerId = idCounterStart;
|
|
423
|
+
timer.order = uniqueTimerOrder++;
|
|
417
424
|
timer.createdAt = clock.now;
|
|
418
425
|
timer.callAt = clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0));
|
|
419
426
|
clock.timers[timer.id] = timer;
|
|
427
|
+
clock.timerHeap.push(timer);
|
|
420
428
|
if (addTimerReturnsObject) {
|
|
421
429
|
const res = {
|
|
422
430
|
refed: true,
|
|
423
431
|
ref: function() {
|
|
424
432
|
this.refed = true;
|
|
425
|
-
return
|
|
433
|
+
return this;
|
|
426
434
|
},
|
|
427
435
|
unref: function() {
|
|
428
436
|
this.refed = false;
|
|
429
|
-
return
|
|
437
|
+
return this;
|
|
430
438
|
},
|
|
431
439
|
hasRef: function() {
|
|
432
440
|
return this.refed;
|
|
433
441
|
},
|
|
434
442
|
refresh: function() {
|
|
435
443
|
timer.callAt = clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0));
|
|
444
|
+
clock.timerHeap.remove(timer);
|
|
445
|
+
timer.order = uniqueTimerOrder++;
|
|
436
446
|
clock.timers[timer.id] = timer;
|
|
437
|
-
|
|
447
|
+
clock.timerHeap.push(timer);
|
|
448
|
+
return this;
|
|
438
449
|
},
|
|
439
450
|
[Symbol.toPrimitive]: function() {
|
|
440
451
|
return timer.id;
|
|
@@ -445,53 +456,124 @@ __webpack_require__.add({
|
|
|
445
456
|
return timer.id;
|
|
446
457
|
}
|
|
447
458
|
function compareTimers(a, b) {
|
|
459
|
+
if ("IdleCallback" === a.type && "IdleCallback" !== b.type) return 1;
|
|
460
|
+
if ("IdleCallback" !== a.type && "IdleCallback" === b.type) return -1;
|
|
448
461
|
if (a.callAt < b.callAt) return -1;
|
|
449
462
|
if (a.callAt > b.callAt) return 1;
|
|
450
463
|
if (a.immediate && !b.immediate) return -1;
|
|
451
464
|
if (!a.immediate && b.immediate) return 1;
|
|
465
|
+
if (a.order < b.order) return -1;
|
|
466
|
+
if (a.order > b.order) return 1;
|
|
452
467
|
if (a.createdAt < b.createdAt) return -1;
|
|
453
468
|
if (a.createdAt > b.createdAt) return 1;
|
|
454
469
|
if (a.id < b.id) return -1;
|
|
455
470
|
if (a.id > b.id) return 1;
|
|
471
|
+
return 0;
|
|
472
|
+
}
|
|
473
|
+
function TimerHeap() {
|
|
474
|
+
this.timers = [];
|
|
456
475
|
}
|
|
476
|
+
TimerHeap.prototype.peek = function() {
|
|
477
|
+
return this.timers[0];
|
|
478
|
+
};
|
|
479
|
+
TimerHeap.prototype.push = function(timer) {
|
|
480
|
+
this.timers.push(timer);
|
|
481
|
+
this.bubbleUp(this.timers.length - 1);
|
|
482
|
+
};
|
|
483
|
+
TimerHeap.prototype.pop = function() {
|
|
484
|
+
if (0 === this.timers.length) return;
|
|
485
|
+
const first = this.timers[0];
|
|
486
|
+
const last = this.timers.pop();
|
|
487
|
+
if (this.timers.length > 0) {
|
|
488
|
+
this.timers[0] = last;
|
|
489
|
+
last.heapIndex = 0;
|
|
490
|
+
this.bubbleDown(0);
|
|
491
|
+
}
|
|
492
|
+
delete first.heapIndex;
|
|
493
|
+
return first;
|
|
494
|
+
};
|
|
495
|
+
TimerHeap.prototype.remove = function(timer) {
|
|
496
|
+
const index = timer.heapIndex;
|
|
497
|
+
if (void 0 === index || this.timers[index] !== timer) return false;
|
|
498
|
+
const last = this.timers.pop();
|
|
499
|
+
if (timer !== last) {
|
|
500
|
+
this.timers[index] = last;
|
|
501
|
+
last.heapIndex = index;
|
|
502
|
+
if (compareTimers(last, timer) < 0) this.bubbleUp(index);
|
|
503
|
+
else this.bubbleDown(index);
|
|
504
|
+
}
|
|
505
|
+
delete timer.heapIndex;
|
|
506
|
+
return true;
|
|
507
|
+
};
|
|
508
|
+
TimerHeap.prototype.bubbleUp = function(index) {
|
|
509
|
+
const timer = this.timers[index];
|
|
510
|
+
let currentIndex = index;
|
|
511
|
+
while(currentIndex > 0){
|
|
512
|
+
const parentIndex = Math.floor((currentIndex - 1) / 2);
|
|
513
|
+
const parent = this.timers[parentIndex];
|
|
514
|
+
if (compareTimers(timer, parent) < 0) {
|
|
515
|
+
this.timers[currentIndex] = parent;
|
|
516
|
+
parent.heapIndex = currentIndex;
|
|
517
|
+
currentIndex = parentIndex;
|
|
518
|
+
} else break;
|
|
519
|
+
}
|
|
520
|
+
this.timers[currentIndex] = timer;
|
|
521
|
+
timer.heapIndex = currentIndex;
|
|
522
|
+
};
|
|
523
|
+
TimerHeap.prototype.bubbleDown = function(index) {
|
|
524
|
+
const timer = this.timers[index];
|
|
525
|
+
let currentIndex = index;
|
|
526
|
+
const halfLength = Math.floor(this.timers.length / 2);
|
|
527
|
+
while(currentIndex < halfLength){
|
|
528
|
+
const leftIndex = 2 * currentIndex + 1;
|
|
529
|
+
const rightIndex = leftIndex + 1;
|
|
530
|
+
let bestChildIndex = leftIndex;
|
|
531
|
+
let bestChild = this.timers[leftIndex];
|
|
532
|
+
if (rightIndex < this.timers.length && compareTimers(this.timers[rightIndex], bestChild) < 0) {
|
|
533
|
+
bestChildIndex = rightIndex;
|
|
534
|
+
bestChild = this.timers[rightIndex];
|
|
535
|
+
}
|
|
536
|
+
if (compareTimers(bestChild, timer) < 0) {
|
|
537
|
+
this.timers[currentIndex] = bestChild;
|
|
538
|
+
bestChild.heapIndex = currentIndex;
|
|
539
|
+
currentIndex = bestChildIndex;
|
|
540
|
+
} else break;
|
|
541
|
+
}
|
|
542
|
+
this.timers[currentIndex] = timer;
|
|
543
|
+
timer.heapIndex = currentIndex;
|
|
544
|
+
};
|
|
457
545
|
function firstTimerInRange(clock, from, to) {
|
|
458
|
-
|
|
546
|
+
if (!clock.timerHeap) return null;
|
|
547
|
+
const timers = clock.timerHeap.timers;
|
|
548
|
+
if (1 === timers.length && timers[0].requestIdleCallback) return timers[0];
|
|
549
|
+
const first = clock.timerHeap.peek();
|
|
550
|
+
if (first && inRange(from, to, first)) return first;
|
|
459
551
|
let timer = null;
|
|
460
|
-
let
|
|
461
|
-
for(id in timers)if (timers.hasOwnProperty(id)) {
|
|
462
|
-
isInRange = inRange(from, to, timers[id]);
|
|
463
|
-
if (isInRange && (!timer || 1 === compareTimers(timer, timers[id]))) timer = timers[id];
|
|
464
|
-
}
|
|
552
|
+
for(let i = 0; i < timers.length; i++)if (inRange(from, to, timers[i]) && (!timer || 1 === compareTimers(timer, timers[i]))) timer = timers[i];
|
|
465
553
|
return timer;
|
|
466
554
|
}
|
|
467
555
|
function firstTimer(clock) {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
let id;
|
|
471
|
-
for(id in timers)if (timers.hasOwnProperty(id)) {
|
|
472
|
-
if (!timer || 1 === compareTimers(timer, timers[id])) timer = timers[id];
|
|
473
|
-
}
|
|
474
|
-
return timer;
|
|
556
|
+
if (!clock.timerHeap) return null;
|
|
557
|
+
return clock.timerHeap.peek() || null;
|
|
475
558
|
}
|
|
476
559
|
function lastTimer(clock) {
|
|
477
|
-
|
|
560
|
+
if (!clock.timerHeap) return null;
|
|
561
|
+
const timers = clock.timerHeap.timers;
|
|
478
562
|
let timer = null;
|
|
479
|
-
let
|
|
480
|
-
for(id in timers)if (timers.hasOwnProperty(id)) {
|
|
481
|
-
if (!timer || -1 === compareTimers(timer, timers[id])) timer = timers[id];
|
|
482
|
-
}
|
|
563
|
+
for(let i = 0; i < timers.length; i++)if (!timer || -1 === compareTimers(timer, timers[i])) timer = timers[i];
|
|
483
564
|
return timer;
|
|
484
565
|
}
|
|
485
566
|
function callTimer(clock, timer) {
|
|
486
|
-
if ("number" == typeof timer.interval)
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
567
|
+
if ("number" == typeof timer.interval) {
|
|
568
|
+
clock.timerHeap.remove(timer);
|
|
569
|
+
timer.callAt += timer.interval;
|
|
570
|
+
timer.order = uniqueTimerOrder++;
|
|
571
|
+
clock.timerHeap.push(timer);
|
|
572
|
+
} else {
|
|
573
|
+
delete clock.timers[timer.id];
|
|
574
|
+
clock.timerHeap.remove(timer);
|
|
494
575
|
}
|
|
576
|
+
if ("function" == typeof timer.func) timer.func.apply(null, timer.args);
|
|
495
577
|
}
|
|
496
578
|
function getClearHandler(ttype) {
|
|
497
579
|
if ("IdleCallback" === ttype || "AnimationFrame" === ttype) return `cancel${ttype}`;
|
|
@@ -521,10 +603,12 @@ __webpack_require__.add({
|
|
|
521
603
|
const stackTrace = new Error().stack.split("\n").slice(1).join("\n");
|
|
522
604
|
warnOnce(`FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.\nTo automatically clean-up native timers, use \`shouldClearNativeTimers\`.\n${stackTrace}`);
|
|
523
605
|
}
|
|
524
|
-
if (
|
|
606
|
+
if (Object.prototype.hasOwnProperty.call(clock.timers, id)) {
|
|
525
607
|
const timer = clock.timers[id];
|
|
526
|
-
if (timer.type === ttype || "Timeout" === timer.type && "Interval" === ttype || "Interval" === timer.type && "Timeout" === ttype)
|
|
527
|
-
|
|
608
|
+
if (timer.type === ttype || "Timeout" === timer.type && "Interval" === ttype || "Interval" === timer.type && "Timeout" === ttype) {
|
|
609
|
+
delete clock.timers[id];
|
|
610
|
+
clock.timerHeap.remove(timer);
|
|
611
|
+
} else {
|
|
528
612
|
const clear = getClearHandler(ttype);
|
|
529
613
|
const schedule = getScheduleHandler(timer.type);
|
|
530
614
|
throw new Error(`Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`);
|
|
@@ -543,7 +627,7 @@ __webpack_require__.add({
|
|
|
543
627
|
const originalPerfDescriptor = Object.getOwnPropertyDescriptor(clock, `_${method}`);
|
|
544
628
|
if (originalPerfDescriptor && originalPerfDescriptor.get && !originalPerfDescriptor.set) Object.defineProperty(_global, method, originalPerfDescriptor);
|
|
545
629
|
else if (originalPerfDescriptor.configurable) _global[method] = clock[`_${method}`];
|
|
546
|
-
} else if (
|
|
630
|
+
} else if (clock[method] && clock[method].hasOwnProperty) _global[method] = clock[`_${method}`];
|
|
547
631
|
else try {
|
|
548
632
|
delete _global[method];
|
|
549
633
|
} catch (ignore) {}
|
|
@@ -562,13 +646,11 @@ __webpack_require__.add({
|
|
|
562
646
|
signal.removeEventListener("abort", listener);
|
|
563
647
|
clock.abortListenerMap.delete(listener);
|
|
564
648
|
}
|
|
565
|
-
if (!clock.
|
|
566
|
-
return
|
|
567
|
-
return clock.timers[key];
|
|
568
|
-
});
|
|
649
|
+
if (!clock.timerHeap) return [];
|
|
650
|
+
return clock.timerHeap.timers.slice();
|
|
569
651
|
}
|
|
570
652
|
function hijackMethod(target, method, clock) {
|
|
571
|
-
clock[method].
|
|
653
|
+
clock[method].hasOwnProperty = Object.prototype.hasOwnProperty.call(target, method);
|
|
572
654
|
clock[`_${method}`] = target[method];
|
|
573
655
|
if ("Date" === method) target[method] = clock[method];
|
|
574
656
|
else if ("Intl" === method) target[method] = clock[method];
|
|
@@ -716,14 +798,23 @@ __webpack_require__.add({
|
|
|
716
798
|
});
|
|
717
799
|
});
|
|
718
800
|
}
|
|
719
|
-
|
|
801
|
+
function getTimeToNextIdlePeriod() {
|
|
720
802
|
let timeToNextIdlePeriod = 0;
|
|
721
803
|
if (clock.countTimers() > 0) timeToNextIdlePeriod = 50;
|
|
804
|
+
return timeToNextIdlePeriod;
|
|
805
|
+
}
|
|
806
|
+
clock.requestIdleCallback = function requestIdleCallback(func, { timeout } = {}) {
|
|
807
|
+
const idleDeadline = {
|
|
808
|
+
didTimeout: true,
|
|
809
|
+
timeRemaining: getTimeToNextIdlePeriod
|
|
810
|
+
};
|
|
722
811
|
const result = addTimer(clock, {
|
|
723
812
|
func: func,
|
|
724
|
-
args:
|
|
725
|
-
|
|
726
|
-
|
|
813
|
+
args: [
|
|
814
|
+
idleDeadline
|
|
815
|
+
],
|
|
816
|
+
delay: timeout,
|
|
817
|
+
requestIdleCallback: true
|
|
727
818
|
});
|
|
728
819
|
return Number(result);
|
|
729
820
|
};
|
|
@@ -797,7 +888,7 @@ __webpack_require__.add({
|
|
|
797
888
|
};
|
|
798
889
|
}
|
|
799
890
|
clock.countTimers = function countTimers() {
|
|
800
|
-
return
|
|
891
|
+
return (clock.timerHeap ? clock.timerHeap.timers.length : 0) + (clock.jobs || []).length;
|
|
801
892
|
};
|
|
802
893
|
clock.requestAnimationFrame = function requestAnimationFrame(func) {
|
|
803
894
|
const result = addTimer(clock, {
|
|
@@ -962,7 +1053,7 @@ __webpack_require__.add({
|
|
|
962
1053
|
resetIsNearInfiniteLimit();
|
|
963
1054
|
return clock.now;
|
|
964
1055
|
}
|
|
965
|
-
numTimers =
|
|
1056
|
+
numTimers = clock.timerHeap.timers.length;
|
|
966
1057
|
if (0 === numTimers) {
|
|
967
1058
|
resetIsNearInfiniteLimit();
|
|
968
1059
|
return clock.now;
|
|
@@ -985,12 +1076,12 @@ __webpack_require__.add({
|
|
|
985
1076
|
runJobs(clock);
|
|
986
1077
|
let numTimers;
|
|
987
1078
|
if (i < clock.loopLimit) {
|
|
988
|
-
if (!clock.
|
|
1079
|
+
if (!clock.timerHeap) {
|
|
989
1080
|
resetIsNearInfiniteLimit();
|
|
990
1081
|
resolve(clock.now);
|
|
991
1082
|
return;
|
|
992
1083
|
}
|
|
993
|
-
numTimers =
|
|
1084
|
+
numTimers = clock.timerHeap.timers.length;
|
|
994
1085
|
if (0 === numTimers) {
|
|
995
1086
|
resetIsNearInfiniteLimit();
|
|
996
1087
|
resolve(clock.now);
|
|
@@ -1039,6 +1130,7 @@ __webpack_require__.add({
|
|
|
1039
1130
|
clock.reset = function reset() {
|
|
1040
1131
|
nanos = 0;
|
|
1041
1132
|
clock.timers = {};
|
|
1133
|
+
clock.timerHeap = new TimerHeap();
|
|
1042
1134
|
clock.jobs = [];
|
|
1043
1135
|
clock.now = start;
|
|
1044
1136
|
};
|
|
@@ -1050,7 +1142,7 @@ __webpack_require__.add({
|
|
|
1050
1142
|
adjustedSystemTime[1] = adjustedSystemTime[1] + nanos;
|
|
1051
1143
|
clock.now = newNow;
|
|
1052
1144
|
nanos = 0;
|
|
1053
|
-
for(id in clock.timers)if (
|
|
1145
|
+
for(id in clock.timers)if (Object.prototype.hasOwnProperty.call(clock.timers, id)) {
|
|
1054
1146
|
timer = clock.timers[id];
|
|
1055
1147
|
timer.createdAt += difference;
|
|
1056
1148
|
timer.callAt += difference;
|
|
@@ -1059,8 +1151,13 @@ __webpack_require__.add({
|
|
|
1059
1151
|
clock.jump = function jump(tickValue) {
|
|
1060
1152
|
const msFloat = "number" == typeof tickValue ? tickValue : parseTime(tickValue);
|
|
1061
1153
|
const ms = Math.floor(msFloat);
|
|
1062
|
-
|
|
1154
|
+
if (clock.timers) {
|
|
1155
|
+
for (const timer of Object.values(clock.timers))if (clock.now + ms > timer.callAt) timer.callAt = clock.now + ms;
|
|
1156
|
+
clock.timerHeap = new TimerHeap();
|
|
1157
|
+
for (const timer of Object.values(clock.timers))clock.timerHeap.push(timer);
|
|
1158
|
+
}
|
|
1063
1159
|
clock.tick(ms);
|
|
1160
|
+
return clock.now;
|
|
1064
1161
|
};
|
|
1065
1162
|
if (isPresent.performance) {
|
|
1066
1163
|
clock.performance = Object.create(null);
|
|
@@ -1081,6 +1178,9 @@ __webpack_require__.add({
|
|
|
1081
1178
|
config.shouldAdvanceTime = config.shouldAdvanceTime || false;
|
|
1082
1179
|
config.advanceTimeDelta = config.advanceTimeDelta || 20;
|
|
1083
1180
|
config.shouldClearNativeTimers = config.shouldClearNativeTimers || false;
|
|
1181
|
+
const hasToFake = Object.prototype.hasOwnProperty.call(config, "toFake");
|
|
1182
|
+
const hasToNotFake = Object.prototype.hasOwnProperty.call(config, "toNotFake");
|
|
1183
|
+
if (hasToFake && hasToNotFake) throw new TypeError("config.toFake and config.toNotFake cannot be used together");
|
|
1084
1184
|
if (config.target) throw new TypeError("config.target is no longer supported. Use `withGlobal(target)` instead.");
|
|
1085
1185
|
function handleMissingTimer(timer) {
|
|
1086
1186
|
if (config.ignoreMissingTimers) return;
|
|
@@ -1093,8 +1193,13 @@ __webpack_require__.add({
|
|
|
1093
1193
|
return uninstall(clock);
|
|
1094
1194
|
};
|
|
1095
1195
|
clock.abortListenerMap = new Map();
|
|
1096
|
-
|
|
1097
|
-
|
|
1196
|
+
if (hasToFake) {
|
|
1197
|
+
clock.methods = config.toFake || [];
|
|
1198
|
+
if (0 === clock.methods.length) clock.methods = Object.keys(timers);
|
|
1199
|
+
} else if (hasToNotFake) {
|
|
1200
|
+
const methodsToNotFake = config.toNotFake || [];
|
|
1201
|
+
clock.methods = Object.keys(timers).filter((method)=>!methodsToNotFake.includes(method));
|
|
1202
|
+
} else clock.methods = Object.keys(timers);
|
|
1098
1203
|
if (true === config.shouldAdvanceTime) clock.setTickMode({
|
|
1099
1204
|
mode: "interval",
|
|
1100
1205
|
delta: config.advanceTimeDelta
|
|
@@ -1362,14 +1467,11 @@ __webpack_require__.add({
|
|
|
1362
1467
|
}
|
|
1363
1468
|
return typeDetect;
|
|
1364
1469
|
});
|
|
1365
|
-
},
|
|
1366
|
-
util (module) {
|
|
1367
|
-
module.exports = __rspack_external_node_util_1b29d436;
|
|
1368
1470
|
}
|
|
1369
1471
|
});
|
|
1370
1472
|
const RealDate = Date;
|
|
1371
1473
|
const loadFakeTimersModule = ()=>{
|
|
1372
|
-
const loaded = __webpack_require__("../../node_modules/.pnpm/@sinonjs+fake-timers@15.
|
|
1474
|
+
const loaded = __webpack_require__("../../node_modules/.pnpm/@sinonjs+fake-timers@15.2.0/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js");
|
|
1373
1475
|
return {
|
|
1374
1476
|
withGlobal: loaded.withGlobal
|
|
1375
1477
|
};
|
|
@@ -1449,6 +1551,7 @@ class FakeTimers {
|
|
|
1449
1551
|
ignoreMissingTimers: true,
|
|
1450
1552
|
...fakeTimersConfig
|
|
1451
1553
|
});
|
|
1554
|
+
this._clock.reset();
|
|
1452
1555
|
this._fakingTime = true;
|
|
1453
1556
|
}
|
|
1454
1557
|
reset() {
|
package/dist/0~generate.js
CHANGED
|
@@ -74,5 +74,4 @@ async function generateCoverageForUntestedFiles(environmentName, uncoveredFiles,
|
|
|
74
74
|
coverageMap.addFileCoverage(coverageData);
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
export { generateCoverage, generate_getIncludedFiles as getIncludedFiles };
|
|
77
|
+
export { generateCoverage };
|
|
@@ -946,185 +946,5 @@ class MagicString {
|
|
|
946
946
|
return this._replaceRegexp(searchValue, replacement);
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
|
|
950
|
-
class Bundle {
|
|
951
|
-
constructor(options = {}){
|
|
952
|
-
this.intro = options.intro || '';
|
|
953
|
-
this.separator = void 0 !== options.separator ? options.separator : '\n';
|
|
954
|
-
this.sources = [];
|
|
955
|
-
this.uniqueSources = [];
|
|
956
|
-
this.uniqueSourceIndexByFilename = {};
|
|
957
|
-
}
|
|
958
|
-
addSource(source) {
|
|
959
|
-
if (source instanceof MagicString) return this.addSource({
|
|
960
|
-
content: source,
|
|
961
|
-
filename: source.filename,
|
|
962
|
-
separator: this.separator
|
|
963
|
-
});
|
|
964
|
-
if (!isObject(source) || !source.content) throw new Error('bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`');
|
|
965
|
-
[
|
|
966
|
-
'filename',
|
|
967
|
-
'ignoreList',
|
|
968
|
-
'indentExclusionRanges',
|
|
969
|
-
'separator'
|
|
970
|
-
].forEach((option)=>{
|
|
971
|
-
if (!hasOwnProp.call(source, option)) source[option] = source.content[option];
|
|
972
|
-
});
|
|
973
|
-
if (void 0 === source.separator) source.separator = this.separator;
|
|
974
|
-
if (source.filename) if (hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {
|
|
975
|
-
const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];
|
|
976
|
-
if (source.content.original !== uniqueSource.content) throw new Error(`Illegal source: same filename (${source.filename}), different contents`);
|
|
977
|
-
} else {
|
|
978
|
-
this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;
|
|
979
|
-
this.uniqueSources.push({
|
|
980
|
-
filename: source.filename,
|
|
981
|
-
content: source.content.original
|
|
982
|
-
});
|
|
983
|
-
}
|
|
984
|
-
this.sources.push(source);
|
|
985
|
-
return this;
|
|
986
|
-
}
|
|
987
|
-
append(str, options) {
|
|
988
|
-
this.addSource({
|
|
989
|
-
content: new MagicString(str),
|
|
990
|
-
separator: options && options.separator || ''
|
|
991
|
-
});
|
|
992
|
-
return this;
|
|
993
|
-
}
|
|
994
|
-
clone() {
|
|
995
|
-
const bundle = new Bundle({
|
|
996
|
-
intro: this.intro,
|
|
997
|
-
separator: this.separator
|
|
998
|
-
});
|
|
999
|
-
this.sources.forEach((source)=>{
|
|
1000
|
-
bundle.addSource({
|
|
1001
|
-
filename: source.filename,
|
|
1002
|
-
content: source.content.clone(),
|
|
1003
|
-
separator: source.separator
|
|
1004
|
-
});
|
|
1005
|
-
});
|
|
1006
|
-
return bundle;
|
|
1007
|
-
}
|
|
1008
|
-
generateDecodedMap(options = {}) {
|
|
1009
|
-
const names = [];
|
|
1010
|
-
let x_google_ignoreList;
|
|
1011
|
-
this.sources.forEach((source)=>{
|
|
1012
|
-
Object.keys(source.content.storedNames).forEach((name)=>{
|
|
1013
|
-
if (!~names.indexOf(name)) names.push(name);
|
|
1014
|
-
});
|
|
1015
|
-
});
|
|
1016
|
-
const mappings = new Mappings(options.hires);
|
|
1017
|
-
if (this.intro) mappings.advance(this.intro);
|
|
1018
|
-
this.sources.forEach((source, i)=>{
|
|
1019
|
-
if (i > 0) mappings.advance(this.separator);
|
|
1020
|
-
const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;
|
|
1021
|
-
const magicString = source.content;
|
|
1022
|
-
const locate = getLocator(magicString.original);
|
|
1023
|
-
if (magicString.intro) mappings.advance(magicString.intro);
|
|
1024
|
-
magicString.firstChunk.eachNext((chunk)=>{
|
|
1025
|
-
const loc = locate(chunk.start);
|
|
1026
|
-
if (chunk.intro.length) mappings.advance(chunk.intro);
|
|
1027
|
-
if (source.filename) if (chunk.edited) mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);
|
|
1028
|
-
else mappings.addUneditedChunk(sourceIndex, chunk, magicString.original, loc, magicString.sourcemapLocations);
|
|
1029
|
-
else mappings.advance(chunk.content);
|
|
1030
|
-
if (chunk.outro.length) mappings.advance(chunk.outro);
|
|
1031
|
-
});
|
|
1032
|
-
if (magicString.outro) mappings.advance(magicString.outro);
|
|
1033
|
-
if (source.ignoreList && -1 !== sourceIndex) {
|
|
1034
|
-
if (void 0 === x_google_ignoreList) x_google_ignoreList = [];
|
|
1035
|
-
x_google_ignoreList.push(sourceIndex);
|
|
1036
|
-
}
|
|
1037
|
-
});
|
|
1038
|
-
return {
|
|
1039
|
-
file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
|
|
1040
|
-
sources: this.uniqueSources.map((source)=>options.file ? getRelativePath(options.file, source.filename) : source.filename),
|
|
1041
|
-
sourcesContent: this.uniqueSources.map((source)=>options.includeContent ? source.content : null),
|
|
1042
|
-
names,
|
|
1043
|
-
mappings: mappings.raw,
|
|
1044
|
-
x_google_ignoreList
|
|
1045
|
-
};
|
|
1046
|
-
}
|
|
1047
|
-
generateMap(options) {
|
|
1048
|
-
return new SourceMap(this.generateDecodedMap(options));
|
|
1049
|
-
}
|
|
1050
|
-
getIndentString() {
|
|
1051
|
-
const indentStringCounts = {};
|
|
1052
|
-
this.sources.forEach((source)=>{
|
|
1053
|
-
const indentStr = source.content._getRawIndentString();
|
|
1054
|
-
if (null === indentStr) return;
|
|
1055
|
-
if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;
|
|
1056
|
-
indentStringCounts[indentStr] += 1;
|
|
1057
|
-
});
|
|
1058
|
-
return Object.keys(indentStringCounts).sort((a, b)=>indentStringCounts[a] - indentStringCounts[b])[0] || '\t';
|
|
1059
|
-
}
|
|
1060
|
-
indent(indentStr) {
|
|
1061
|
-
if (!arguments.length) indentStr = this.getIndentString();
|
|
1062
|
-
if ('' === indentStr) return this;
|
|
1063
|
-
let trailingNewline = !this.intro || '\n' === this.intro.slice(-1);
|
|
1064
|
-
this.sources.forEach((source, i)=>{
|
|
1065
|
-
const separator = void 0 !== source.separator ? source.separator : this.separator;
|
|
1066
|
-
const indentStart = trailingNewline || i > 0 && /\r?\n$/.test(separator);
|
|
1067
|
-
source.content.indent(indentStr, {
|
|
1068
|
-
exclude: source.indentExclusionRanges,
|
|
1069
|
-
indentStart
|
|
1070
|
-
});
|
|
1071
|
-
trailingNewline = '\n' === source.content.lastChar();
|
|
1072
|
-
});
|
|
1073
|
-
if (this.intro) this.intro = indentStr + this.intro.replace(/^[^\n]/gm, (match, index)=>index > 0 ? indentStr + match : match);
|
|
1074
|
-
return this;
|
|
1075
|
-
}
|
|
1076
|
-
prepend(str) {
|
|
1077
|
-
this.intro = str + this.intro;
|
|
1078
|
-
return this;
|
|
1079
|
-
}
|
|
1080
|
-
toString() {
|
|
1081
|
-
const body = this.sources.map((source, i)=>{
|
|
1082
|
-
const separator = void 0 !== source.separator ? source.separator : this.separator;
|
|
1083
|
-
const str = (i > 0 ? separator : '') + source.content.toString();
|
|
1084
|
-
return str;
|
|
1085
|
-
}).join('');
|
|
1086
|
-
return this.intro + body;
|
|
1087
|
-
}
|
|
1088
|
-
isEmpty() {
|
|
1089
|
-
if (this.intro.length && this.intro.trim()) return false;
|
|
1090
|
-
if (this.sources.some((source)=>!source.content.isEmpty())) return false;
|
|
1091
|
-
return true;
|
|
1092
|
-
}
|
|
1093
|
-
length() {
|
|
1094
|
-
return this.sources.reduce((length, source)=>length + source.content.length(), this.intro.length);
|
|
1095
|
-
}
|
|
1096
|
-
trimLines() {
|
|
1097
|
-
return this.trim('[\\r\\n]');
|
|
1098
|
-
}
|
|
1099
|
-
trim(charType) {
|
|
1100
|
-
return this.trimStart(charType).trimEnd(charType);
|
|
1101
|
-
}
|
|
1102
|
-
trimStart(charType) {
|
|
1103
|
-
const rx = new RegExp('^' + (charType || '\\s') + '+');
|
|
1104
|
-
this.intro = this.intro.replace(rx, '');
|
|
1105
|
-
if (!this.intro) {
|
|
1106
|
-
let source;
|
|
1107
|
-
let i = 0;
|
|
1108
|
-
do {
|
|
1109
|
-
source = this.sources[i++];
|
|
1110
|
-
if (!source) break;
|
|
1111
|
-
}while (!source.content.trimStartAborted(charType));
|
|
1112
|
-
}
|
|
1113
|
-
return this;
|
|
1114
|
-
}
|
|
1115
|
-
trimEnd(charType) {
|
|
1116
|
-
const rx = new RegExp((charType || '\\s') + '+$');
|
|
1117
|
-
let source;
|
|
1118
|
-
let i = this.sources.length - 1;
|
|
1119
|
-
do {
|
|
1120
|
-
source = this.sources[i--];
|
|
1121
|
-
if (!source) {
|
|
1122
|
-
this.intro = this.intro.replace(rx, '');
|
|
1123
|
-
break;
|
|
1124
|
-
}
|
|
1125
|
-
}while (!source.content.trimEndAborted(charType));
|
|
1126
|
-
return this;
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
949
|
+
Object.prototype.hasOwnProperty;
|
|
1129
950
|
export default MagicString;
|
|
1130
|
-
export { Bundle, SourceMap };
|
package/dist/0~restart.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
2
|
+
import { __webpack_require__ } from "./0~rslib-runtime.js";
|
|
3
3
|
import node_path from "node:path";
|
|
4
4
|
import { color as logger_color, logger as logger_logger, isTTY } from "./6830.js";
|
|
5
5
|
import { runRest } from "./3145.js";
|
package/dist/0~snapshot.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! LICENSE: 0~snapshot.js.LICENSE.txt */
|
|
2
2
|
import "node:module";
|
|
3
|
-
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
|
+
import { __webpack_require__ } from "./0~rslib-runtime.js";
|
|
4
4
|
import { resolve as pathe_M_eThtNZ_resolve, getTaskNameWithPrefix } from "./6830.js";
|
|
5
5
|
import { format, dist_plugins } from "./9784.js";
|
|
6
6
|
import { iterableEquality, dist_equals, subsetEquality } from "./1949.js";
|