@procore/hammer-test-jest 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/index.d.mts +8 -17
- package/dist/index.d.ts +8 -17
- package/dist/index.js +7 -30
- package/dist/index.mjs +7 -29
- package/dist/transforms/file.test.js +152 -67
- package/dist/transforms/file.test.mjs +152 -67
- package/dist/transforms/reactSvg.test.js +152 -67
- package/dist/transforms/reactSvg.test.mjs +152 -67
- package/package.json +14 -15
|
@@ -7863,7 +7863,14 @@ function clone(val, seen, options = defaultCloneOptions) {
|
|
|
7863
7863
|
if (!descriptor)
|
|
7864
7864
|
continue;
|
|
7865
7865
|
const cloned = clone(val[k22], seen, options);
|
|
7866
|
-
if (
|
|
7866
|
+
if (options.forceWritable) {
|
|
7867
|
+
Object.defineProperty(out, k22, {
|
|
7868
|
+
enumerable: descriptor.enumerable,
|
|
7869
|
+
configurable: true,
|
|
7870
|
+
writable: true,
|
|
7871
|
+
value: cloned
|
|
7872
|
+
});
|
|
7873
|
+
} else if ("get" in descriptor) {
|
|
7867
7874
|
Object.defineProperty(out, k22, {
|
|
7868
7875
|
...descriptor,
|
|
7869
7876
|
get() {
|
|
@@ -7873,7 +7880,6 @@ function clone(val, seen, options = defaultCloneOptions) {
|
|
|
7873
7880
|
} else {
|
|
7874
7881
|
Object.defineProperty(out, k22, {
|
|
7875
7882
|
...descriptor,
|
|
7876
|
-
writable: options.forceWritable ? true : descriptor.writable,
|
|
7877
7883
|
value: cloned
|
|
7878
7884
|
});
|
|
7879
7885
|
}
|
|
@@ -8035,7 +8041,7 @@ function objDisplay(obj, options = {}) {
|
|
|
8035
8041
|
if (options.truncate && str.length >= options.truncate) {
|
|
8036
8042
|
if (type2 === "[object Function]") {
|
|
8037
8043
|
const fn2 = obj;
|
|
8038
|
-
return !fn2.name
|
|
8044
|
+
return !fn2.name ? "[Function]" : `[Function: ${fn2.name}]`;
|
|
8039
8045
|
} else if (type2 === "[object Array]") {
|
|
8040
8046
|
return `[ Array(${obj.length}) ]`;
|
|
8041
8047
|
} else if (type2 === "[object Object]") {
|
|
@@ -8475,6 +8481,7 @@ function joinAlignedDiffsExpand(diffs, options) {
|
|
|
8475
8481
|
}
|
|
8476
8482
|
var noColor = (string3) => string3;
|
|
8477
8483
|
var DIFF_CONTEXT_DEFAULT = 5;
|
|
8484
|
+
var DIFF_TRUNCATE_THRESHOLD_DEFAULT = 0;
|
|
8478
8485
|
function getDefaultOptions() {
|
|
8479
8486
|
const c2 = getColors();
|
|
8480
8487
|
return {
|
|
@@ -8495,7 +8502,10 @@ function getDefaultOptions() {
|
|
|
8495
8502
|
expand: true,
|
|
8496
8503
|
includeChangeCounts: false,
|
|
8497
8504
|
omitAnnotationLines: false,
|
|
8498
|
-
patchColor: c2.yellow
|
|
8505
|
+
patchColor: c2.yellow,
|
|
8506
|
+
truncateThreshold: DIFF_TRUNCATE_THRESHOLD_DEFAULT,
|
|
8507
|
+
truncateAnnotation: "... Diff result is truncated",
|
|
8508
|
+
truncateAnnotationColor: noColor
|
|
8499
8509
|
};
|
|
8500
8510
|
}
|
|
8501
8511
|
function getCompareKeys(compareKeys) {
|
|
@@ -8563,16 +8573,21 @@ ${bColor(b2)}
|
|
|
8563
8573
|
|
|
8564
8574
|
`;
|
|
8565
8575
|
}
|
|
8566
|
-
function printDiffLines(diffs, options) {
|
|
8567
|
-
return printAnnotation(options, countChanges(diffs)) + (options.expand ? joinAlignedDiffsExpand(diffs, options) : joinAlignedDiffsNoExpand(diffs, options))
|
|
8576
|
+
function printDiffLines(diffs, truncated, options) {
|
|
8577
|
+
return printAnnotation(options, countChanges(diffs)) + (options.expand ? joinAlignedDiffsExpand(diffs, options) : joinAlignedDiffsNoExpand(diffs, options)) + (truncated ? options.truncateAnnotationColor(`
|
|
8578
|
+
${options.truncateAnnotation}`) : "");
|
|
8568
8579
|
}
|
|
8569
8580
|
function diffLinesUnified(aLines, bLines, options) {
|
|
8581
|
+
const normalizedOptions = normalizeDiffOptions(options);
|
|
8582
|
+
const [diffs, truncated] = diffLinesRaw(
|
|
8583
|
+
isEmptyString(aLines) ? [] : aLines,
|
|
8584
|
+
isEmptyString(bLines) ? [] : bLines,
|
|
8585
|
+
normalizedOptions
|
|
8586
|
+
);
|
|
8570
8587
|
return printDiffLines(
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
),
|
|
8575
|
-
normalizeDiffOptions(options)
|
|
8588
|
+
diffs,
|
|
8589
|
+
truncated,
|
|
8590
|
+
normalizedOptions
|
|
8576
8591
|
);
|
|
8577
8592
|
}
|
|
8578
8593
|
function diffLinesUnified2(aLinesDisplay, bLinesDisplay, aLinesCompare, bLinesCompare, options) {
|
|
@@ -8587,7 +8602,7 @@ function diffLinesUnified2(aLinesDisplay, bLinesDisplay, aLinesCompare, bLinesCo
|
|
|
8587
8602
|
if (aLinesDisplay.length !== aLinesCompare.length || bLinesDisplay.length !== bLinesCompare.length) {
|
|
8588
8603
|
return diffLinesUnified(aLinesDisplay, bLinesDisplay, options);
|
|
8589
8604
|
}
|
|
8590
|
-
const diffs = diffLinesRaw(aLinesCompare, bLinesCompare);
|
|
8605
|
+
const [diffs, truncated] = diffLinesRaw(aLinesCompare, bLinesCompare, options);
|
|
8591
8606
|
let aIndex = 0;
|
|
8592
8607
|
let bIndex = 0;
|
|
8593
8608
|
diffs.forEach((diff2) => {
|
|
@@ -8606,11 +8621,14 @@ function diffLinesUnified2(aLinesDisplay, bLinesDisplay, aLinesCompare, bLinesCo
|
|
|
8606
8621
|
bIndex += 1;
|
|
8607
8622
|
}
|
|
8608
8623
|
});
|
|
8609
|
-
return printDiffLines(diffs, normalizeDiffOptions(options));
|
|
8610
|
-
}
|
|
8611
|
-
function diffLinesRaw(aLines, bLines) {
|
|
8612
|
-
const
|
|
8613
|
-
const
|
|
8624
|
+
return printDiffLines(diffs, truncated, normalizeDiffOptions(options));
|
|
8625
|
+
}
|
|
8626
|
+
function diffLinesRaw(aLines, bLines, options) {
|
|
8627
|
+
const truncate2 = (options == null ? void 0 : options.truncateThreshold) ?? false;
|
|
8628
|
+
const truncateThreshold = Math.max(Math.floor((options == null ? void 0 : options.truncateThreshold) ?? 0), 0);
|
|
8629
|
+
const aLength = truncate2 ? Math.min(aLines.length, truncateThreshold) : aLines.length;
|
|
8630
|
+
const bLength = truncate2 ? Math.min(bLines.length, truncateThreshold) : bLines.length;
|
|
8631
|
+
const truncated = aLength !== aLines.length || bLength !== bLines.length;
|
|
8614
8632
|
const isCommon = (aIndex2, bIndex2) => aLines[aIndex2] === bLines[bIndex2];
|
|
8615
8633
|
const diffs = [];
|
|
8616
8634
|
let aIndex = 0;
|
|
@@ -8629,7 +8647,7 @@ function diffLinesRaw(aLines, bLines) {
|
|
|
8629
8647
|
diffs.push(new Diff(DIFF_DELETE, aLines[aIndex]));
|
|
8630
8648
|
for (; bIndex !== bLength; bIndex += 1)
|
|
8631
8649
|
diffs.push(new Diff(DIFF_INSERT, bLines[bIndex]));
|
|
8632
|
-
return diffs;
|
|
8650
|
+
return [diffs, truncated];
|
|
8633
8651
|
}
|
|
8634
8652
|
function getCommonMessage(message, options) {
|
|
8635
8653
|
const { commonColor } = normalizeDiffOptions(options);
|
|
@@ -9819,10 +9837,10 @@ function createSuiteCollector(name, factory = () => {
|
|
|
9819
9837
|
}
|
|
9820
9838
|
if (runner.config.includeTaskLocation) {
|
|
9821
9839
|
const limit = Error.stackTraceLimit;
|
|
9822
|
-
Error.stackTraceLimit =
|
|
9840
|
+
Error.stackTraceLimit = 15;
|
|
9823
9841
|
const error = new Error("stacktrace").stack;
|
|
9824
9842
|
Error.stackTraceLimit = limit;
|
|
9825
|
-
const stack =
|
|
9843
|
+
const stack = findTestFileStackTrace(error, task2.each ?? false);
|
|
9826
9844
|
if (stack)
|
|
9827
9845
|
task2.location = stack;
|
|
9828
9846
|
}
|
|
@@ -9875,18 +9893,12 @@ function createSuiteCollector(name, factory = () => {
|
|
|
9875
9893
|
};
|
|
9876
9894
|
if (runner && includeLocation && runner.config.includeTaskLocation) {
|
|
9877
9895
|
const limit = Error.stackTraceLimit;
|
|
9878
|
-
Error.stackTraceLimit =
|
|
9896
|
+
Error.stackTraceLimit = 15;
|
|
9879
9897
|
const error = new Error("stacktrace").stack;
|
|
9880
9898
|
Error.stackTraceLimit = limit;
|
|
9881
|
-
const stack =
|
|
9882
|
-
if (stack)
|
|
9883
|
-
suite2.location =
|
|
9884
|
-
line: stack.line,
|
|
9885
|
-
// because source map is boundary based, this line leads to ")" in test.each()[(]),
|
|
9886
|
-
// but it should be the next opening bracket - here we assume it's on the same line
|
|
9887
|
-
column: each ? stack.column + 1 : stack.column
|
|
9888
|
-
};
|
|
9889
|
-
}
|
|
9899
|
+
const stack = findTestFileStackTrace(error, suite2.each ?? false);
|
|
9900
|
+
if (stack)
|
|
9901
|
+
suite2.location = stack;
|
|
9890
9902
|
}
|
|
9891
9903
|
setHooks(suite2, createSuiteHooks());
|
|
9892
9904
|
}
|
|
@@ -10030,8 +10042,8 @@ function formatTemplateString(cases, args) {
|
|
|
10030
10042
|
}
|
|
10031
10043
|
return res;
|
|
10032
10044
|
}
|
|
10033
|
-
function
|
|
10034
|
-
const lines = error.split("\n").slice(
|
|
10045
|
+
function findTestFileStackTrace(error, each) {
|
|
10046
|
+
const lines = error.split("\n").slice(1);
|
|
10035
10047
|
for (const line of lines) {
|
|
10036
10048
|
const stack = parseSingleStack(line);
|
|
10037
10049
|
if (stack && stack.file === getTestFilepath()) {
|
|
@@ -10170,7 +10182,7 @@ function isFirstRun() {
|
|
|
10170
10182
|
return firstRun;
|
|
10171
10183
|
}
|
|
10172
10184
|
|
|
10173
|
-
// ../../node_modules/vitest/dist/vendor/vi.
|
|
10185
|
+
// ../../node_modules/vitest/dist/vendor/vi.Y_w82WR8.js
|
|
10174
10186
|
init_esm_shims();
|
|
10175
10187
|
|
|
10176
10188
|
// ../../node_modules/chai/index.mjs
|
|
@@ -10698,7 +10710,7 @@ function iterableEquality(a, b2, customTesters = [], aStack = [], bStack = []) {
|
|
|
10698
10710
|
return iterableEquality(
|
|
10699
10711
|
a2,
|
|
10700
10712
|
b22,
|
|
10701
|
-
[...
|
|
10713
|
+
[...customTesters],
|
|
10702
10714
|
[...aStack],
|
|
10703
10715
|
[...bStack]
|
|
10704
10716
|
);
|
|
@@ -10776,7 +10788,7 @@ function subsetEquality(object2, subset, customTesters = []) {
|
|
|
10776
10788
|
if (!isObjectWithKeys(subset2))
|
|
10777
10789
|
return void 0;
|
|
10778
10790
|
return Object.keys(subset2).every((key) => {
|
|
10779
|
-
if (
|
|
10791
|
+
if (typeof subset2[key] === "object") {
|
|
10780
10792
|
if (seenReferences.has(subset2[key]))
|
|
10781
10793
|
return equals(object22[key], subset2[key], filteredCustomTesters);
|
|
10782
10794
|
seenReferences.set(subset2[key], true);
|
|
@@ -10840,6 +10852,57 @@ Received: serializes to the same string
|
|
|
10840
10852
|
function pluralize(word, count) {
|
|
10841
10853
|
return `${count} ${word}${count === 1 ? "" : "s"}`;
|
|
10842
10854
|
}
|
|
10855
|
+
function getObjectKeys(object2) {
|
|
10856
|
+
return [
|
|
10857
|
+
...Object.keys(object2),
|
|
10858
|
+
...Object.getOwnPropertySymbols(object2).filter(
|
|
10859
|
+
(s) => {
|
|
10860
|
+
var _a2;
|
|
10861
|
+
return (_a2 = Object.getOwnPropertyDescriptor(object2, s)) == null ? void 0 : _a2.enumerable;
|
|
10862
|
+
}
|
|
10863
|
+
)
|
|
10864
|
+
];
|
|
10865
|
+
}
|
|
10866
|
+
function getObjectSubset(object2, subset, customTesters = []) {
|
|
10867
|
+
let stripped = 0;
|
|
10868
|
+
const getObjectSubsetWithContext = (seenReferences = /* @__PURE__ */ new WeakMap()) => (object22, subset2) => {
|
|
10869
|
+
if (Array.isArray(object22)) {
|
|
10870
|
+
if (Array.isArray(subset2) && subset2.length === object22.length) {
|
|
10871
|
+
return subset2.map(
|
|
10872
|
+
(sub, i2) => getObjectSubsetWithContext(seenReferences)(object22[i2], sub)
|
|
10873
|
+
);
|
|
10874
|
+
}
|
|
10875
|
+
} else if (object22 instanceof Date) {
|
|
10876
|
+
return object22;
|
|
10877
|
+
} else if (isObject(object22) && isObject(subset2)) {
|
|
10878
|
+
if (equals(object22, subset2, [
|
|
10879
|
+
...customTesters,
|
|
10880
|
+
iterableEquality,
|
|
10881
|
+
subsetEquality
|
|
10882
|
+
])) {
|
|
10883
|
+
return subset2;
|
|
10884
|
+
}
|
|
10885
|
+
const trimmed = {};
|
|
10886
|
+
seenReferences.set(object22, trimmed);
|
|
10887
|
+
for (const key of getObjectKeys(object22)) {
|
|
10888
|
+
if (hasPropertyInObject(subset2, key)) {
|
|
10889
|
+
trimmed[key] = seenReferences.has(object22[key]) ? seenReferences.get(object22[key]) : getObjectSubsetWithContext(seenReferences)(object22[key], subset2[key]);
|
|
10890
|
+
} else {
|
|
10891
|
+
if (!seenReferences.has(object22[key])) {
|
|
10892
|
+
stripped += 1;
|
|
10893
|
+
if (isObject(object22[key]))
|
|
10894
|
+
stripped += getObjectKeys(object22[key]).length;
|
|
10895
|
+
getObjectSubsetWithContext(seenReferences)(object22[key], subset2[key]);
|
|
10896
|
+
}
|
|
10897
|
+
}
|
|
10898
|
+
}
|
|
10899
|
+
if (getObjectKeys(trimmed).length > 0)
|
|
10900
|
+
return trimmed;
|
|
10901
|
+
}
|
|
10902
|
+
return object22;
|
|
10903
|
+
};
|
|
10904
|
+
return { subset: getObjectSubsetWithContext()(object2, subset), stripped };
|
|
10905
|
+
}
|
|
10843
10906
|
var AsymmetricMatcher3 = class {
|
|
10844
10907
|
constructor(sample, inverse = false) {
|
|
10845
10908
|
this.sample = sample;
|
|
@@ -11267,16 +11330,30 @@ var JestChaiExpect = (chai3, utils) => {
|
|
|
11267
11330
|
});
|
|
11268
11331
|
def("toMatchObject", function(expected) {
|
|
11269
11332
|
const actual = this._obj;
|
|
11270
|
-
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11333
|
+
const pass = equals(actual, expected, [...customTesters, iterableEquality, subsetEquality]);
|
|
11334
|
+
const isNot = utils.flag(this, "negate");
|
|
11335
|
+
const { subset: actualSubset, stripped } = getObjectSubset(actual, expected);
|
|
11336
|
+
if (pass && isNot || !pass && !isNot) {
|
|
11337
|
+
const msg = utils.getMessage(
|
|
11338
|
+
this,
|
|
11339
|
+
[
|
|
11340
|
+
pass,
|
|
11341
|
+
"expected #{this} to match object #{exp}",
|
|
11342
|
+
"expected #{this} to not match object #{exp}",
|
|
11343
|
+
expected,
|
|
11344
|
+
actualSubset,
|
|
11345
|
+
false
|
|
11346
|
+
]
|
|
11347
|
+
);
|
|
11348
|
+
const message = stripped === 0 ? msg : `${msg}
|
|
11349
|
+
(${stripped} matching ${stripped === 1 ? "property" : "properties"} omitted from actual)`;
|
|
11350
|
+
throw new AssertionError2(message, { showDiff: true, expected, actual: actualSubset });
|
|
11351
|
+
}
|
|
11277
11352
|
});
|
|
11278
11353
|
def("toMatch", function(expected) {
|
|
11279
11354
|
const actual = this._obj;
|
|
11355
|
+
if (typeof actual !== "string")
|
|
11356
|
+
throw new TypeError(`.toMatch() expects to receive a string, but got ${typeof actual}`);
|
|
11280
11357
|
return this.assert(
|
|
11281
11358
|
typeof expected === "string" ? actual.includes(expected) : actual.match(expected),
|
|
11282
11359
|
`expected #{this} to match #{exp}`,
|
|
@@ -11618,12 +11695,15 @@ Number of calls: ${c2().bold(spy.mock.calls.length)}
|
|
|
11618
11695
|
const spy = getSpy(this);
|
|
11619
11696
|
const spyName = spy.getMockName();
|
|
11620
11697
|
const nthCall = spy.mock.calls[times - 1];
|
|
11698
|
+
const callCount = spy.mock.calls.length;
|
|
11699
|
+
const isCalled = times <= callCount;
|
|
11621
11700
|
this.assert(
|
|
11622
11701
|
equals(nthCall, args, [...customTesters, iterableEquality]),
|
|
11623
|
-
`expected ${ordinalOf(times)} "${spyName}" call to have been called with #{exp}`,
|
|
11702
|
+
`expected ${ordinalOf(times)} "${spyName}" call to have been called with #{exp}${isCalled ? `` : `, but called only ${callCount} times`}`,
|
|
11624
11703
|
`expected ${ordinalOf(times)} "${spyName}" call to not have been called with #{exp}`,
|
|
11625
11704
|
args,
|
|
11626
|
-
nthCall
|
|
11705
|
+
nthCall,
|
|
11706
|
+
isCalled
|
|
11627
11707
|
);
|
|
11628
11708
|
});
|
|
11629
11709
|
def(["toHaveBeenLastCalledWith", "lastCalledWith"], function(...args) {
|
|
@@ -13394,7 +13474,7 @@ function resetDate() {
|
|
|
13394
13474
|
globalThis.Date = RealDate;
|
|
13395
13475
|
}
|
|
13396
13476
|
|
|
13397
|
-
// ../../node_modules/vitest/dist/vendor/vi.
|
|
13477
|
+
// ../../node_modules/vitest/dist/vendor/vi.Y_w82WR8.js
|
|
13398
13478
|
function resetModules(modules, resetMocks = false) {
|
|
13399
13479
|
const skipPaths = [
|
|
13400
13480
|
// Vitest
|
|
@@ -15519,12 +15599,14 @@ function createVitest() {
|
|
|
15519
15599
|
let _mockedDate = null;
|
|
15520
15600
|
let _config = null;
|
|
15521
15601
|
const workerState = getWorkerState();
|
|
15522
|
-
|
|
15602
|
+
let _timers;
|
|
15603
|
+
const timers = () => _timers || (_timers = new FakeTimers({
|
|
15523
15604
|
global: globalThis,
|
|
15524
15605
|
config: workerState.config.fakeTimers
|
|
15525
|
-
});
|
|
15606
|
+
}));
|
|
15526
15607
|
const _stubsGlobal = /* @__PURE__ */ new Map();
|
|
15527
15608
|
const _stubsEnv = /* @__PURE__ */ new Map();
|
|
15609
|
+
const _envBooleans = ["PROD", "DEV", "SSR"];
|
|
15528
15610
|
const getImporter = () => {
|
|
15529
15611
|
const stackTrace = createSimpleStackTrace({ stackTraceLimit: 4 });
|
|
15530
15612
|
const importerStack = stackTrace.split("\n")[4];
|
|
@@ -15542,73 +15624,73 @@ function createVitest() {
|
|
|
15542
15624
|
}
|
|
15543
15625
|
}
|
|
15544
15626
|
if (config2)
|
|
15545
|
-
|
|
15627
|
+
timers().configure({ ...workerState.config.fakeTimers, ...config2 });
|
|
15546
15628
|
else
|
|
15547
|
-
|
|
15548
|
-
|
|
15629
|
+
timers().configure(workerState.config.fakeTimers);
|
|
15630
|
+
timers().useFakeTimers();
|
|
15549
15631
|
return utils;
|
|
15550
15632
|
},
|
|
15551
15633
|
isFakeTimers() {
|
|
15552
|
-
return
|
|
15634
|
+
return timers().isFakeTimers();
|
|
15553
15635
|
},
|
|
15554
15636
|
useRealTimers() {
|
|
15555
|
-
|
|
15637
|
+
timers().useRealTimers();
|
|
15556
15638
|
_mockedDate = null;
|
|
15557
15639
|
return utils;
|
|
15558
15640
|
},
|
|
15559
15641
|
runOnlyPendingTimers() {
|
|
15560
|
-
|
|
15642
|
+
timers().runOnlyPendingTimers();
|
|
15561
15643
|
return utils;
|
|
15562
15644
|
},
|
|
15563
15645
|
async runOnlyPendingTimersAsync() {
|
|
15564
|
-
await
|
|
15646
|
+
await timers().runOnlyPendingTimersAsync();
|
|
15565
15647
|
return utils;
|
|
15566
15648
|
},
|
|
15567
15649
|
runAllTimers() {
|
|
15568
|
-
|
|
15650
|
+
timers().runAllTimers();
|
|
15569
15651
|
return utils;
|
|
15570
15652
|
},
|
|
15571
15653
|
async runAllTimersAsync() {
|
|
15572
|
-
await
|
|
15654
|
+
await timers().runAllTimersAsync();
|
|
15573
15655
|
return utils;
|
|
15574
15656
|
},
|
|
15575
15657
|
runAllTicks() {
|
|
15576
|
-
|
|
15658
|
+
timers().runAllTicks();
|
|
15577
15659
|
return utils;
|
|
15578
15660
|
},
|
|
15579
15661
|
advanceTimersByTime(ms) {
|
|
15580
|
-
|
|
15662
|
+
timers().advanceTimersByTime(ms);
|
|
15581
15663
|
return utils;
|
|
15582
15664
|
},
|
|
15583
15665
|
async advanceTimersByTimeAsync(ms) {
|
|
15584
|
-
await
|
|
15666
|
+
await timers().advanceTimersByTimeAsync(ms);
|
|
15585
15667
|
return utils;
|
|
15586
15668
|
},
|
|
15587
15669
|
advanceTimersToNextTimer() {
|
|
15588
|
-
|
|
15670
|
+
timers().advanceTimersToNextTimer();
|
|
15589
15671
|
return utils;
|
|
15590
15672
|
},
|
|
15591
15673
|
async advanceTimersToNextTimerAsync() {
|
|
15592
|
-
await
|
|
15674
|
+
await timers().advanceTimersToNextTimerAsync();
|
|
15593
15675
|
return utils;
|
|
15594
15676
|
},
|
|
15595
15677
|
getTimerCount() {
|
|
15596
|
-
return
|
|
15678
|
+
return timers().getTimerCount();
|
|
15597
15679
|
},
|
|
15598
15680
|
setSystemTime(time) {
|
|
15599
15681
|
const date = time instanceof Date ? time : new Date(time);
|
|
15600
15682
|
_mockedDate = date;
|
|
15601
|
-
|
|
15683
|
+
timers().setSystemTime(date);
|
|
15602
15684
|
return utils;
|
|
15603
15685
|
},
|
|
15604
15686
|
getMockedSystemTime() {
|
|
15605
15687
|
return _mockedDate;
|
|
15606
15688
|
},
|
|
15607
15689
|
getRealSystemTime() {
|
|
15608
|
-
return
|
|
15690
|
+
return timers().getRealSystemTime();
|
|
15609
15691
|
},
|
|
15610
15692
|
clearAllTimers() {
|
|
15611
|
-
|
|
15693
|
+
timers().clearAllTimers();
|
|
15612
15694
|
return utils;
|
|
15613
15695
|
},
|
|
15614
15696
|
// mocks
|
|
@@ -15687,7 +15769,10 @@ function createVitest() {
|
|
|
15687
15769
|
stubEnv(name, value) {
|
|
15688
15770
|
if (!_stubsEnv.has(name))
|
|
15689
15771
|
_stubsEnv.set(name, process.env[name]);
|
|
15690
|
-
|
|
15772
|
+
if (_envBooleans.includes(name))
|
|
15773
|
+
process.env[name] = value ? "1" : "";
|
|
15774
|
+
else
|
|
15775
|
+
process.env[name] = String(value);
|
|
15691
15776
|
return utils;
|
|
15692
15777
|
},
|
|
15693
15778
|
unstubAllGlobals() {
|
|
@@ -15732,7 +15817,7 @@ function createVitest() {
|
|
|
15732
15817
|
var vitest = createVitest();
|
|
15733
15818
|
var vi = vitest;
|
|
15734
15819
|
|
|
15735
|
-
// ../../node_modules/vitest/dist/vendor/index.
|
|
15820
|
+
// ../../node_modules/vitest/dist/vendor/index.0RrMQKD8.js
|
|
15736
15821
|
init_esm_shims();
|
|
15737
15822
|
function getRunningMode() {
|
|
15738
15823
|
return process.env.VITEST_MODE === "WATCH" ? "watch" : "run";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procore/hammer-test-jest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Hammer test runner, jest",
|
|
5
5
|
"author": "Procore Technologies, Inc",
|
|
6
6
|
"homepage": "https://github.com/procore/hammer/packages/test-jest",
|
|
@@ -35,40 +35,39 @@
|
|
|
35
35
|
"exec": "exec",
|
|
36
36
|
"format": "prettier --ignore-unknown --write --cache .",
|
|
37
37
|
"format:check": "prettier --ignore-unknown --check --cache .",
|
|
38
|
-
"lint": "eslint . --cache",
|
|
38
|
+
"lint:code": "eslint . --cache",
|
|
39
|
+
"lint:types": "tsc --noEmit",
|
|
39
40
|
"prepack": "tsup",
|
|
40
41
|
"test": "vitest run",
|
|
41
|
-
"test:ci": "vitest run --coverage"
|
|
42
|
+
"test:ci": "vitest run --coverage",
|
|
43
|
+
"test:watch": "vitest"
|
|
42
44
|
},
|
|
43
45
|
"dependencies": {
|
|
44
46
|
"@babel/core": "^7.24.4",
|
|
45
47
|
"@babel/preset-env": "^7.24.4",
|
|
46
48
|
"@babel/preset-react": "^7.24.1",
|
|
47
49
|
"@babel/preset-typescript": "^7.24.1",
|
|
50
|
+
"@procore/hammer-types": "^0.3.0",
|
|
48
51
|
"babel-jest": "^29.7.0",
|
|
49
|
-
"cli-highlight": "^2.1.11",
|
|
50
52
|
"identity-obj-proxy": "^3.0.0",
|
|
51
53
|
"jest": "^29.7.0",
|
|
52
54
|
"jest-cli": "^29.7.0",
|
|
53
|
-
"jest-watch-typeahead": "^2.2.2"
|
|
54
|
-
"picocolors": "^1.0.0"
|
|
55
|
+
"jest-watch-typeahead": "^2.2.2"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@procore/prettier-config": "^1.0.0",
|
|
58
|
-
"@types/node": "^20.12.
|
|
59
|
-
"@
|
|
60
|
-
"@typescript-eslint/
|
|
61
|
-
"@
|
|
62
|
-
"@vitest/coverage-v8": "^1.4.0",
|
|
59
|
+
"@types/node": "^20.12.7",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
|
61
|
+
"@typescript-eslint/parser": "^7.7.1",
|
|
62
|
+
"@vitest/coverage-v8": "^1.5.1",
|
|
63
63
|
"eslint": "^8.57.0",
|
|
64
64
|
"eslint-define-config": "^2.1.0",
|
|
65
65
|
"lint-staged": "^15.2.2",
|
|
66
|
+
"pathe": "^1.1.2",
|
|
66
67
|
"prettier": "^3.2.5",
|
|
67
68
|
"rimraf": "^5.0.5",
|
|
68
|
-
"strip-ansi": "^7.1.0",
|
|
69
69
|
"tsup": "^8.0.2",
|
|
70
|
-
"typescript": "^5.4.
|
|
71
|
-
"vitest": "^1.
|
|
72
|
-
"vitest-mock-process": "^1.0.4"
|
|
70
|
+
"typescript": "^5.4.5",
|
|
71
|
+
"vitest": "^1.5.1"
|
|
73
72
|
}
|
|
74
73
|
}
|