@systemfsoftware/stryker-js-vitest-runner 7.1.0 → 7.1.1
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/CHANGELOG.md +6 -0
- package/dist/main.mjs +222 -186
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-vitest-runner
|
|
2
2
|
|
|
3
|
+
## 7.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Exported declarations that previously took `unknown` now take a defaulted type parameter: calls that omit the type argument are unchanged, and calls that were previously rejected for passing an unconstrained value are accepted. No runtime behaviour changes.
|
|
8
|
+
|
|
3
9
|
## 7.1.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/main.mjs
CHANGED
|
@@ -3519,41 +3519,6 @@ const fromUndefinedOr = (a) => a === void 0 ? none() : some(a);
|
|
|
3519
3519
|
*/
|
|
3520
3520
|
const getOrUndefined$1 = /*#__PURE__*/ getOrElse$1(constUndefined);
|
|
3521
3521
|
/**
|
|
3522
|
-
* Lifts a function that may throw into one that returns an `Option`.
|
|
3523
|
-
*
|
|
3524
|
-
* **When to use**
|
|
3525
|
-
*
|
|
3526
|
-
* Use to wrap exception-throwing APIs (e.g. `JSON.parse`) for safe usage
|
|
3527
|
-
*
|
|
3528
|
-
* **Details**
|
|
3529
|
-
*
|
|
3530
|
-
* - If the function returns normally → `Some` with the result
|
|
3531
|
-
* - If the function throws → `None` (exception is swallowed)
|
|
3532
|
-
*
|
|
3533
|
-
* **Example** (Lifting JSON.parse)
|
|
3534
|
-
*
|
|
3535
|
-
* ```ts import.meta.vitest
|
|
3536
|
-
* import { Option } from "effect"
|
|
3537
|
-
*
|
|
3538
|
-
* const parse = Option.liftThrowable(JSON.parse)
|
|
3539
|
-
*
|
|
3540
|
-
* parse("1") // => Option.some(1)
|
|
3541
|
-
* parse("") // => Option.none()
|
|
3542
|
-
* ```
|
|
3543
|
-
*
|
|
3544
|
-
* @see {@link liftNullishOr} for nullable-returning functions
|
|
3545
|
-
*
|
|
3546
|
-
* @category converting
|
|
3547
|
-
* @since 2.0.0
|
|
3548
|
-
*/
|
|
3549
|
-
const liftThrowable = (f) => (...a) => {
|
|
3550
|
-
try {
|
|
3551
|
-
return some(f(...a));
|
|
3552
|
-
} catch {
|
|
3553
|
-
return none();
|
|
3554
|
-
}
|
|
3555
|
-
};
|
|
3556
|
-
/**
|
|
3557
3522
|
* Transforms the value inside a `Some` using the provided function, leaving
|
|
3558
3523
|
* `None` unchanged.
|
|
3559
3524
|
*
|
|
@@ -6923,7 +6888,7 @@ const fiberInterruptAs = /*#__PURE__*/ dual((args) => hasProperty(args[0], Fiber
|
|
|
6923
6888
|
let ann = fiberStackAnnotations(parent);
|
|
6924
6889
|
ann = ann && annotations ? merge$1(ann, annotations) : ann ?? annotations;
|
|
6925
6890
|
self.interruptUnsafe(fiberId, ann);
|
|
6926
|
-
return asVoid(fiberAwait(self));
|
|
6891
|
+
return asVoid$1(fiberAwait(self));
|
|
6927
6892
|
}));
|
|
6928
6893
|
/** @internal */
|
|
6929
6894
|
const fiberInterruptAll = (fibers) => withFiber$1((parent) => {
|
|
@@ -6933,7 +6898,7 @@ const fiberInterruptAll = (fibers) => withFiber$1((parent) => {
|
|
|
6933
6898
|
fiber.interruptUnsafe(parent.id, annotations);
|
|
6934
6899
|
fiberArr.push(fiber);
|
|
6935
6900
|
}
|
|
6936
|
-
return asVoid(fiberAwaitAll(fiberArr));
|
|
6901
|
+
return asVoid$1(fiberAwaitAll(fiberArr));
|
|
6937
6902
|
});
|
|
6938
6903
|
/** @internal */
|
|
6939
6904
|
const succeed$4 = exitSucceed;
|
|
@@ -7208,7 +7173,7 @@ const andThen$3 = /*#__PURE__*/ dual(2, (self, f) => new ContImpl(self, isEffect
|
|
|
7208
7173
|
/** @internal */
|
|
7209
7174
|
const tap$3 = /*#__PURE__*/ dual(2, (self, f) => new ContImpl(self, isEffect$1(f) ? tapEffectCont : tapCont, f));
|
|
7210
7175
|
/** @internal */
|
|
7211
|
-
const asVoid = (self) => new ContImpl(self, returnPayload, exitVoid);
|
|
7176
|
+
const asVoid$1 = (self) => new ContImpl(self, returnPayload, exitVoid);
|
|
7212
7177
|
/** @internal */
|
|
7213
7178
|
const raceAllFirst = (all, options) => withFiber$1((parent) => callback$2((resume) => {
|
|
7214
7179
|
let done = false;
|
|
@@ -8149,6 +8114,15 @@ const withSpan$1 = function() {
|
|
|
8149
8114
|
return (self, ...args) => useSpan$1(name, fnArg ? fnArg(...args) : options, (span) => withParentSpan(self, span, traceOptions));
|
|
8150
8115
|
};
|
|
8151
8116
|
/** @internal */
|
|
8117
|
+
const annotateCurrentSpan$1 = (...args) => withFiber$1((fiber) => {
|
|
8118
|
+
const span = fiber.currentSpanLocal;
|
|
8119
|
+
if (span) {
|
|
8120
|
+
if (args.length === 1) for (const [key, value] of Object.entries(args[0])) span.attribute(key, value);
|
|
8121
|
+
else span.attribute(args[0], args[1]);
|
|
8122
|
+
}
|
|
8123
|
+
return void_$3;
|
|
8124
|
+
});
|
|
8125
|
+
/** @internal */
|
|
8152
8126
|
const ClockRef = /*#__PURE__*/ Reference("effect/Clock", { defaultValue: () => new ClockImpl() });
|
|
8153
8127
|
const MAX_TIMER_MILLIS = 2 ** 31 - 1;
|
|
8154
8128
|
var ClockImpl = class {
|
|
@@ -12029,6 +12003,23 @@ const as = as$1;
|
|
|
12029
12003
|
*/
|
|
12030
12004
|
const asSome = asSome$1;
|
|
12031
12005
|
/**
|
|
12006
|
+
* Maps the success value of an `Effect` to `void`, preserving failures.
|
|
12007
|
+
*
|
|
12008
|
+
* **Example** (Discarding success values)
|
|
12009
|
+
*
|
|
12010
|
+
* ```ts import.meta.vitest
|
|
12011
|
+
* import { Effect } from "effect"
|
|
12012
|
+
*
|
|
12013
|
+
* const program = Effect.asVoid(Effect.succeed(42))
|
|
12014
|
+
*
|
|
12015
|
+
* Effect.runSync(program) // => undefined
|
|
12016
|
+
* ```
|
|
12017
|
+
*
|
|
12018
|
+
* @category mapping
|
|
12019
|
+
* @since 2.0.0
|
|
12020
|
+
*/
|
|
12021
|
+
const asVoid = asVoid$1;
|
|
12022
|
+
/**
|
|
12032
12023
|
* Combines two effects sequentially and applies a function to their results to
|
|
12033
12024
|
* produce a single value.
|
|
12034
12025
|
*
|
|
@@ -13395,6 +13386,30 @@ const interruptible = interruptible$1;
|
|
|
13395
13386
|
*/
|
|
13396
13387
|
const forever = forever$1;
|
|
13397
13388
|
/**
|
|
13389
|
+
* Adds an annotation to the current span if available.
|
|
13390
|
+
*
|
|
13391
|
+
* **Example** (Annotating the current span)
|
|
13392
|
+
*
|
|
13393
|
+
* ```ts import.meta.vitest
|
|
13394
|
+
* import { Effect } from "effect"
|
|
13395
|
+
*
|
|
13396
|
+
* const program = Effect.gen(function*() {
|
|
13397
|
+
* yield* Effect.annotateCurrentSpan("userId", "123")
|
|
13398
|
+
* yield* Effect.annotateCurrentSpan({
|
|
13399
|
+
* operation: "user-lookup"
|
|
13400
|
+
* })
|
|
13401
|
+
* return "success"
|
|
13402
|
+
* })
|
|
13403
|
+
*
|
|
13404
|
+
* const traced = Effect.withSpan(program, "user-operation")
|
|
13405
|
+
* Effect.runSync(traced) // => "success"
|
|
13406
|
+
* ```
|
|
13407
|
+
*
|
|
13408
|
+
* @category tracing
|
|
13409
|
+
* @since 2.0.0
|
|
13410
|
+
*/
|
|
13411
|
+
const annotateCurrentSpan = annotateCurrentSpan$1;
|
|
13412
|
+
/**
|
|
13398
13413
|
* Create a new span for tracing, and automatically close it when the effect
|
|
13399
13414
|
* completes.
|
|
13400
13415
|
*
|
|
@@ -18816,7 +18831,7 @@ function make$25(schema) {
|
|
|
18816
18831
|
* @category guards
|
|
18817
18832
|
* @since 3.10.0
|
|
18818
18833
|
*/
|
|
18819
|
-
function is$
|
|
18834
|
+
function is$1(schema) {
|
|
18820
18835
|
return _is(schema.ast);
|
|
18821
18836
|
}
|
|
18822
18837
|
function makeIs(ast) {
|
|
@@ -21205,7 +21220,7 @@ function toStandardSchemaV1(self, options) {
|
|
|
21205
21220
|
* @category guards
|
|
21206
21221
|
* @since 3.10.0
|
|
21207
21222
|
*/
|
|
21208
|
-
const is
|
|
21223
|
+
const is = is$1;
|
|
21209
21224
|
/**
|
|
21210
21225
|
* Decodes an `unknown` input against a schema, returning an `Effect` that
|
|
21211
21226
|
* succeeds with the decoded value or fails with a {@link SchemaError}.
|
|
@@ -23212,14 +23227,6 @@ const discriminator = (field) => (...pattern) => {
|
|
|
23212
23227
|
/** @internal */
|
|
23213
23228
|
const tag$1 = /*#__PURE__*/ discriminator("_tag");
|
|
23214
23229
|
/** @internal */
|
|
23215
|
-
const is$1 = (...literals) => {
|
|
23216
|
-
const len = literals.length;
|
|
23217
|
-
return (u) => {
|
|
23218
|
-
for (let i = 0; i < len; i++) if (u === literals[i]) return true;
|
|
23219
|
-
return false;
|
|
23220
|
-
};
|
|
23221
|
-
};
|
|
23222
|
-
/** @internal */
|
|
23223
23230
|
const defined$1 = (u) => u !== void 0 && u !== null;
|
|
23224
23231
|
/** @internal */
|
|
23225
23232
|
const instanceOf$1 = (constructor) => (u) => u instanceof constructor;
|
|
@@ -23420,46 +23427,6 @@ const when = when$1;
|
|
|
23420
23427
|
*/
|
|
23421
23428
|
const tag = tag$1;
|
|
23422
23429
|
/**
|
|
23423
|
-
* Matches a specific set of literal values (e.g., `Match.is("a", 42, true)`).
|
|
23424
|
-
*
|
|
23425
|
-
* **When to use**
|
|
23426
|
-
*
|
|
23427
|
-
* Use to match one of several literal primitive or null values.
|
|
23428
|
-
*
|
|
23429
|
-
* **Details**
|
|
23430
|
-
*
|
|
23431
|
-
* This function creates a predicate that matches any of the provided literal values.
|
|
23432
|
-
* It's useful for matching against multiple specific values in a single pattern.
|
|
23433
|
-
*
|
|
23434
|
-
* **Example** (Matching literal values)
|
|
23435
|
-
*
|
|
23436
|
-
* ```ts import.meta.vitest
|
|
23437
|
-
* import { Match } from "effect"
|
|
23438
|
-
*
|
|
23439
|
-
* const handleStatus = Match.type<string | number>()
|
|
23440
|
-
* .pipe(
|
|
23441
|
-
* Match.when(Match.is("success", "ok", 200), () => "Operation successful"),
|
|
23442
|
-
* Match.when(Match.is("error", "failed", 500), () => "Operation failed"),
|
|
23443
|
-
* Match.when(Match.is(0, false, null), () => "Falsy value"),
|
|
23444
|
-
* Match.orElse((value) => `Unknown status: ${value}`)
|
|
23445
|
-
* )
|
|
23446
|
-
*
|
|
23447
|
-
* handleStatus("success") // => "Operation successful"
|
|
23448
|
-
*
|
|
23449
|
-
* handleStatus(200) // => "Operation successful"
|
|
23450
|
-
*
|
|
23451
|
-
* handleStatus("failed") // => "Operation failed"
|
|
23452
|
-
*
|
|
23453
|
-
* handleStatus(0) // => "Falsy value"
|
|
23454
|
-
*
|
|
23455
|
-
* handleStatus("pending") // => "Unknown status: pending"
|
|
23456
|
-
* ```
|
|
23457
|
-
*
|
|
23458
|
-
* @category guards
|
|
23459
|
-
* @since 4.0.0
|
|
23460
|
-
*/
|
|
23461
|
-
const is = is$1;
|
|
23462
|
-
/**
|
|
23463
23430
|
* Matches values of type `string`.
|
|
23464
23431
|
*
|
|
23465
23432
|
* **Details**
|
|
@@ -30067,9 +30034,14 @@ function normalizeFileName(fileName) {
|
|
|
30067
30034
|
}
|
|
30068
30035
|
const hasText = (value) => isString(value) && value.length > 0;
|
|
30069
30036
|
const textIfNonEmpty = (value) => getOrUndefined$1(filter(fromUndefinedOr(value), hasText));
|
|
30070
|
-
|
|
30071
|
-
return
|
|
30072
|
-
}
|
|
30037
|
+
function readFieldOf(record, key) {
|
|
30038
|
+
return record[key];
|
|
30039
|
+
}
|
|
30040
|
+
const hasFieldIn = (value, key) => key in value;
|
|
30041
|
+
const fieldOf = (value, key) => {
|
|
30042
|
+
if (!hasFieldIn(value, key)) return;
|
|
30043
|
+
return readFieldOf(value, key);
|
|
30044
|
+
};
|
|
30073
30045
|
const hasStringCode = (error) => value(fieldOf(error, "code")).pipe(when(string, () => true), orElse$1(() => false));
|
|
30074
30046
|
function isErrnoException(error) {
|
|
30075
30047
|
return value(error).pipe(when(instanceOf(Error), hasStringCode), orElse$1(() => false));
|
|
@@ -30093,19 +30065,29 @@ const isNonPlaceholderText = (text) => value({
|
|
|
30093
30065
|
hasLength: true,
|
|
30094
30066
|
isPlaceholder: false
|
|
30095
30067
|
}, () => true), orElse$1(() => false));
|
|
30096
|
-
const isUsableText = (value$
|
|
30097
|
-
const usableText = (value
|
|
30098
|
-
const objectToStringText = (value$
|
|
30068
|
+
const isUsableText = (value$8) => value(value$8).pipe(when(string, isNonPlaceholderText), orElse$1(() => false));
|
|
30069
|
+
const usableText = (value) => isUsableText(value) ? value : "";
|
|
30070
|
+
const objectToStringText = (value$12) => value(fieldOf(value$12, "toString")).pipe(when(instanceOf(Function), (callable) => {
|
|
30099
30071
|
try {
|
|
30100
|
-
return usableText(Reflect.apply(callable, value$
|
|
30072
|
+
return usableText(Reflect.apply(callable, value$12, []));
|
|
30101
30073
|
} catch {
|
|
30102
30074
|
return "";
|
|
30103
30075
|
}
|
|
30104
30076
|
}), orElse$1(() => ""));
|
|
30105
30077
|
const isObjectType = (cause) => typeof cause === "object";
|
|
30106
|
-
const
|
|
30107
|
-
const
|
|
30108
|
-
const
|
|
30078
|
+
const isNonNullObjectType = (error) => error !== null && isObjectType(error);
|
|
30079
|
+
const toStringText = (error) => isNonNullObjectType(error) ? objectToStringText(error) : "";
|
|
30080
|
+
const stringifyRest = (error) => {
|
|
30081
|
+
const json = jsonText(error);
|
|
30082
|
+
return hasText(json) ? json : toStringText(error);
|
|
30083
|
+
};
|
|
30084
|
+
function primitiveJsonOf(error) {
|
|
30085
|
+
return isJsonPrimitive(error) ? JSON.stringify(error) : void 0;
|
|
30086
|
+
}
|
|
30087
|
+
const stringifyNonError = (error) => typeof error === "string" ? error : nonStringTextOf(error);
|
|
30088
|
+
function nonStringTextOf(error) {
|
|
30089
|
+
return primitiveJsonOf(error) ?? stringifyRest(error);
|
|
30090
|
+
}
|
|
30109
30091
|
const errorText = (error) => value(error).pipe(when(isErrnoException, formatErrnoException), orElse$1(() => formatError(error)));
|
|
30110
30092
|
function errorToString(error) {
|
|
30111
30093
|
return value(error).pipe(when(isEmptyError, () => ""), when(instanceOf(Error), errorText), orElse$1(() => stringifyNonError(error)));
|
|
@@ -30298,9 +30280,10 @@ function withOperator(node, operator) {
|
|
|
30298
30280
|
function mutantsWhen(holds, build) {
|
|
30299
30281
|
return value(holds).pipe(when(true, build), orElse$1(() => NO_MUTANTS));
|
|
30300
30282
|
}
|
|
30301
|
-
|
|
30283
|
+
const hasPropertyIn = (node, key) => key in node;
|
|
30284
|
+
const readPropertyOf = (node, key) => hasPropertyIn(node, key) ? node[key] : void 0;
|
|
30302
30285
|
function propertyOf$1(node, key) {
|
|
30303
|
-
return
|
|
30286
|
+
return isObject(node) ? readPropertyOf(node, key) : void 0;
|
|
30304
30287
|
}
|
|
30305
30288
|
function isIdentifier(node) {
|
|
30306
30289
|
return nodeType(node) === "Identifier";
|
|
@@ -31165,7 +31148,8 @@ function frozenContainer(value) {
|
|
|
31165
31148
|
freezableChildren(object).forEach((child) => {
|
|
31166
31149
|
deepFreeze(child);
|
|
31167
31150
|
});
|
|
31168
|
-
|
|
31151
|
+
Object.freeze(object);
|
|
31152
|
+
return value;
|
|
31169
31153
|
});
|
|
31170
31154
|
}
|
|
31171
31155
|
function freezableChildren(value) {
|
|
@@ -31790,7 +31774,7 @@ const ThresholdsValuesSchema = Struct({
|
|
|
31790
31774
|
high: Percentage,
|
|
31791
31775
|
low: Percentage
|
|
31792
31776
|
});
|
|
31793
|
-
const isThresholds = (value) => is
|
|
31777
|
+
const isThresholds = (value) => is(ThresholdsValuesSchema)(value) && value.low <= value.high;
|
|
31794
31778
|
/**
|
|
31795
31779
|
* The pair is *built* ordered — a drawn pair is sorted — rather than drawn at
|
|
31796
31780
|
* random and discarded until it happens to be ordered. The invariant lives on
|
|
@@ -32145,7 +32129,7 @@ const MutationScoreThresholdsValuesSchema = Struct({
|
|
|
32145
32129
|
low: defaulted(Percentage, 60),
|
|
32146
32130
|
break: defaulted(NullOr(Percentage), null)
|
|
32147
32131
|
});
|
|
32148
|
-
const isMutationScoreThresholds = (value) => is
|
|
32132
|
+
const isMutationScoreThresholds = (value) => is(MutationScoreThresholdsValuesSchema)(value) && value.low <= value.high;
|
|
32149
32133
|
/**
|
|
32150
32134
|
* The pair is *built* ordered — a drawn pair is sorted — rather than drawn at
|
|
32151
32135
|
* random and discarded until it happens to be ordered. The invariant lives on
|
|
@@ -56369,23 +56353,23 @@ var VitestMutantRunCommand = class extends TaggedClass()("VitestMutantRunCommand
|
|
|
56369
56353
|
}) {};
|
|
56370
56354
|
const VitestMutantRunTypeId = Symbol.for("@systemfsoftware/stryker-js-vitest-runner/VitestMutantRun");
|
|
56371
56355
|
var MutantKilled = class extends TaggedClass()("Killed", {
|
|
56372
|
-
|
|
56356
|
+
tests: ArraySchema(TestResultSchema),
|
|
56373
56357
|
killerIds: optional(ArraySchema(String$2)),
|
|
56374
56358
|
failureMessage: optional(String$2)
|
|
56375
56359
|
}) {
|
|
56376
56360
|
[VitestMutantRunTypeId] = VitestMutantRunTypeId;
|
|
56377
56361
|
};
|
|
56378
|
-
var MutantSurvived = class extends TaggedClass()("Survived", {
|
|
56362
|
+
var MutantSurvived = class extends TaggedClass()("Survived", { tests: ArraySchema(TestResultSchema) }) {
|
|
56379
56363
|
[VitestMutantRunTypeId] = VitestMutantRunTypeId;
|
|
56380
56364
|
};
|
|
56381
56365
|
var MutantTimeout = class extends TaggedClass()("Timeout", {
|
|
56382
|
-
|
|
56366
|
+
tests: ArraySchema(TestResultSchema),
|
|
56383
56367
|
reason: optional(String$2)
|
|
56384
56368
|
}) {
|
|
56385
56369
|
[VitestMutantRunTypeId] = VitestMutantRunTypeId;
|
|
56386
56370
|
};
|
|
56387
56371
|
var MutantDryError = class extends TaggedClass()("Error", {
|
|
56388
|
-
|
|
56372
|
+
tests: ArraySchema(TestResultSchema),
|
|
56389
56373
|
errorMessage: optional(String$2)
|
|
56390
56374
|
}) {
|
|
56391
56375
|
[VitestMutantRunTypeId] = VitestMutantRunTypeId;
|
|
@@ -56401,17 +56385,23 @@ var VitestDryRunCommand$1 = class extends TaggedClass()("VitestDryRunCommand", {
|
|
|
56401
56385
|
}) {};
|
|
56402
56386
|
var VitestDryRunOutput = class extends TaggedClass()("VitestDryRunOutput", {
|
|
56403
56387
|
status: Literals(["Complete", "Error"]),
|
|
56404
|
-
|
|
56388
|
+
tests: ArraySchema(TestResultSchema),
|
|
56405
56389
|
errorMessage: optional(String$2)
|
|
56406
56390
|
}) {};
|
|
56407
|
-
const
|
|
56408
|
-
const
|
|
56409
|
-
const
|
|
56410
|
-
const
|
|
56411
|
-
const
|
|
56412
|
-
const
|
|
56413
|
-
const
|
|
56414
|
-
const
|
|
56391
|
+
const isRecordValue$1 = (value) => isObject(value);
|
|
56392
|
+
const recordOption$1 = (value) => liftPredicate(value, isRecordValue$1);
|
|
56393
|
+
const asString$1 = (value) => typeof value === "string";
|
|
56394
|
+
const asNumber$1 = (value) => typeof value === "number";
|
|
56395
|
+
const asStringOption$1 = (value) => liftPredicate(value, asString$1);
|
|
56396
|
+
const asNumberOption$1 = (value) => liftPredicate(value, asNumber$1);
|
|
56397
|
+
const asArrayOption$1 = (value) => liftPredicate(value, Array.isArray);
|
|
56398
|
+
const getStringField$1 = (record, key) => asStringOption$1(record[key]);
|
|
56399
|
+
const getNumberField$1 = (record, key) => asNumberOption$1(record[key]);
|
|
56400
|
+
const getSuite$1 = (value) => flatMap$5(recordOption$1(value), (rec) => fromNullishOr(rec["suite"]));
|
|
56401
|
+
const getFile$1 = (value) => flatMap$5(recordOption$1(value), (rec) => fromNullishOr(rec["file"]));
|
|
56402
|
+
const getResult$1 = (value) => flatMap$5(recordOption$1(value), (rec) => fromNullishOr(rec["result"]));
|
|
56403
|
+
const getErrors$1 = (value) => flatMap$5(recordOption$1(value), (rec) => asArrayOption$1(rec["errors"]));
|
|
56404
|
+
const getMessage$1 = (value) => flatMap$5(recordOption$1(value), (rec) => getStringField$1(rec, "message"));
|
|
56415
56405
|
const getName$1 = (value) => match$5(recordOption$1(value), {
|
|
56416
56406
|
onNone: () => "",
|
|
56417
56407
|
onSome: (rec) => getOrElse$1(getStringField$1(rec, "name"), () => "")
|
|
@@ -56420,14 +56410,26 @@ const getMode$1 = (value) => match$5(recordOption$1(value), {
|
|
|
56420
56410
|
onNone: () => "run",
|
|
56421
56411
|
onSome: (rec) => getOrElse$1(getStringField$1(rec, "mode"), () => "run")
|
|
56422
56412
|
});
|
|
56423
|
-
const
|
|
56413
|
+
const TASK_STATES$1 = Object.freeze({
|
|
56414
|
+
pass: "pass",
|
|
56415
|
+
fail: "fail",
|
|
56416
|
+
skip: "skip",
|
|
56417
|
+
todo: "todo",
|
|
56418
|
+
run: "run",
|
|
56419
|
+
queued: "queued",
|
|
56420
|
+
only: "only"
|
|
56421
|
+
});
|
|
56422
|
+
const getState$1 = (value) => match$5(asStringOption$1(value), {
|
|
56423
|
+
onNone: () => void 0,
|
|
56424
|
+
onSome: (state) => TASK_STATES$1[state]
|
|
56425
|
+
});
|
|
56424
56426
|
const getDuration$1 = (value) => match$5(recordOption$1(value), {
|
|
56425
56427
|
onNone: () => 0,
|
|
56426
56428
|
onSome: (rec) => getOrElse$1(getNumberField$1(rec, "duration"), () => 0)
|
|
56427
56429
|
});
|
|
56428
56430
|
const getFilepath$1 = (value) => match$5(recordOption$1(value), {
|
|
56429
56431
|
onNone: () => void 0,
|
|
56430
|
-
onSome: (rec) => getOrUndefined$1(
|
|
56432
|
+
onSome: (rec) => getOrUndefined$1(getStringField$1(rec, "filepath"))
|
|
56431
56433
|
});
|
|
56432
56434
|
const collectSuiteNames$1 = (suite) => match$5(fromNullishOr(suite), {
|
|
56433
56435
|
onNone: () => [],
|
|
@@ -56511,16 +56513,17 @@ const extractFailureMessage$1 = (test) => match$5(getResult$1(test), {
|
|
|
56511
56513
|
});
|
|
56512
56514
|
const convertTestRaw$1 = (test, projectRoot) => {
|
|
56513
56515
|
const status = extractStatus$1(test);
|
|
56516
|
+
const fileNameField = value(extractFileName$1(test)).pipe(when(void 0, () => ({})), orElse$1((fileName) => ({ fileName })));
|
|
56514
56517
|
const base = {
|
|
56515
56518
|
id: extractRawId$1(test, projectRoot),
|
|
56516
56519
|
name: extractName$1(test),
|
|
56517
56520
|
timeSpentMs: extractDuration$1(test),
|
|
56518
|
-
|
|
56519
|
-
|
|
56521
|
+
status,
|
|
56522
|
+
...fileNameField
|
|
56520
56523
|
};
|
|
56521
56524
|
return value(status).pipe(when("failed", () => ({
|
|
56522
56525
|
...base,
|
|
56523
|
-
status,
|
|
56526
|
+
status: "failed",
|
|
56524
56527
|
failureMessage: extractFailureMessage$1(test)
|
|
56525
56528
|
})), when("skipped", () => value(findSuiteErrorRaw$1(getOrUndefined$1(getSuite$1(test)))).pipe(when(defined, (suiteError) => ({
|
|
56526
56529
|
...base,
|
|
@@ -56528,10 +56531,10 @@ const convertTestRaw$1 = (test, projectRoot) => {
|
|
|
56528
56531
|
failureMessage: suiteError
|
|
56529
56532
|
})), orElse$1(() => ({
|
|
56530
56533
|
...base,
|
|
56531
|
-
status
|
|
56534
|
+
status: "skipped"
|
|
56532
56535
|
})))), orElse$1(() => ({
|
|
56533
56536
|
...base,
|
|
56534
|
-
status
|
|
56537
|
+
status: "success"
|
|
56535
56538
|
})));
|
|
56536
56539
|
};
|
|
56537
56540
|
/**
|
|
@@ -56541,19 +56544,19 @@ const convertTestRaw$1 = (test, projectRoot) => {
|
|
|
56541
56544
|
const isSilentExternalError = (tests, command) => value(tests.some((test) => test.status === "failed")).pipe(when(true, () => false), when(false, () => command.hasExternalError), exhaustive);
|
|
56542
56545
|
const decideVitestDryRun$1 = (command) => value(command.rawTests.map((t) => convertTestRaw$1(t, command.projectRoot))).pipe(when((tests) => isSilentExternalError(tests, command), (tests) => succeed$5(VitestDryRunOutput.make({
|
|
56543
56546
|
status: "Error",
|
|
56544
|
-
|
|
56547
|
+
tests,
|
|
56545
56548
|
errorMessage: `An error occurred outside of a test run: ${command.externalErrorText}`
|
|
56546
56549
|
}))), orElse$1((tests) => succeed$5(VitestDryRunOutput.make({
|
|
56547
56550
|
status: "Complete",
|
|
56548
|
-
|
|
56551
|
+
tests,
|
|
56549
56552
|
errorMessage: void 0
|
|
56550
56553
|
}))));
|
|
56551
56554
|
const hitLimitReason = (hitCount, hitLimit) => flatMap$5(fromNullishOr(hitCount), (count) => flatMap$5(fromNullishOr(hitLimit), (limit) => value(count > limit).pipe(when(true, () => some(hitLimitReachedReason(count, limit))), when(false, () => none()), exhaustive)));
|
|
56552
56555
|
const decideVitestMutantRun = (command) => value(hitLimitReason(command.hitCount, command.hitLimit)).pipe(when(isSome, (hit) => value(isNamedTrap(command.activeMutantId, command.namedTrapId)).pipe(when(true, () => succeed$5(MutantTimeout.make({
|
|
56553
|
-
|
|
56556
|
+
tests: [],
|
|
56554
56557
|
reason: hit.value
|
|
56555
56558
|
}))), when(false, () => succeed$5(MutantKilled.make({
|
|
56556
|
-
|
|
56559
|
+
tests: [],
|
|
56557
56560
|
failureMessage: hit.value
|
|
56558
56561
|
}))), exhaustive)), when(isNone, () => {
|
|
56559
56562
|
const dryOut = decideVitestDryRun$1(VitestDryRunCommand$1.make({
|
|
@@ -56565,15 +56568,14 @@ const decideVitestMutantRun = (command) => value(hitLimitReason(command.hitCount
|
|
|
56565
56568
|
return value(isFailure(dryOut)).pipe(when(true, () => fail$5(new VitestMutantRunError({ message: "dry run mapping failed" }))), when(false, () => {
|
|
56566
56569
|
const dry = getOrElse(dryOut, () => VitestDryRunOutput.make({
|
|
56567
56570
|
status: "Complete",
|
|
56568
|
-
|
|
56571
|
+
tests: [],
|
|
56569
56572
|
errorMessage: void 0
|
|
56570
56573
|
}));
|
|
56571
56574
|
return value(dry.status === "Error").pipe(when(true, () => succeed$5(MutantDryError.make({
|
|
56572
|
-
|
|
56575
|
+
tests: [],
|
|
56573
56576
|
errorMessage: dry.errorMessage
|
|
56574
56577
|
}))), when(false, () => {
|
|
56575
|
-
const
|
|
56576
|
-
const killed = getOrElse$1(testsOption, () => []).filter((t) => t.status === "failed");
|
|
56578
|
+
const killed = dry.tests.filter((t) => t.status === "failed");
|
|
56577
56579
|
return value(killed.length > 0).pipe(when(true, () => value(command.reportAllKillers).pipe(when(true, () => {
|
|
56578
56580
|
const firstKiller = fromNullishOr(killed[0]);
|
|
56579
56581
|
const failureMessage = match$5(firstKiller, {
|
|
@@ -56581,7 +56583,7 @@ const decideVitestMutantRun = (command) => value(hitLimitReason(command.hitCount
|
|
|
56581
56583
|
onSome: (k) => k.failureMessage
|
|
56582
56584
|
});
|
|
56583
56585
|
return succeed$5(MutantKilled.make({
|
|
56584
|
-
|
|
56586
|
+
tests: dry.tests,
|
|
56585
56587
|
killerIds: killed.map((t) => t.id),
|
|
56586
56588
|
failureMessage
|
|
56587
56589
|
}));
|
|
@@ -56592,21 +56594,21 @@ const decideVitestMutantRun = (command) => value(hitLimitReason(command.hitCount
|
|
|
56592
56594
|
onSome: (k) => k.failureMessage
|
|
56593
56595
|
});
|
|
56594
56596
|
return value(isSome(first)).pipe(when(true, () => succeed$5(MutantKilled.make({
|
|
56595
|
-
|
|
56597
|
+
tests: dry.tests,
|
|
56596
56598
|
killerIds: match$5(first, {
|
|
56597
56599
|
onNone: () => void 0,
|
|
56598
56600
|
onSome: (k) => [k.id]
|
|
56599
56601
|
}),
|
|
56600
56602
|
failureMessage
|
|
56601
56603
|
}))), when(false, () => succeed$5(MutantKilled.make({
|
|
56602
|
-
|
|
56604
|
+
tests: dry.tests,
|
|
56603
56605
|
killerIds: getOrUndefined$1(match$5(first, {
|
|
56604
56606
|
onNone: () => none(),
|
|
56605
56607
|
onSome: (k) => some([k.id])
|
|
56606
56608
|
})),
|
|
56607
56609
|
failureMessage
|
|
56608
56610
|
}))), exhaustive);
|
|
56609
|
-
}), exhaustive)), when(false, () => succeed$5(MutantSurvived.make({
|
|
56611
|
+
}), exhaustive)), when(false, () => succeed$5(MutantSurvived.make({ tests: dry.tests }))), exhaustive);
|
|
56610
56612
|
}), exhaustive);
|
|
56611
56613
|
}), exhaustive);
|
|
56612
56614
|
}), exhaustive);
|
|
@@ -56641,9 +56643,9 @@ var VitestDryRunCommand = class extends TaggedClass()("VitestDryRunCommand", {
|
|
|
56641
56643
|
hasExternalError: Boolean$2,
|
|
56642
56644
|
externalErrorText: String$2
|
|
56643
56645
|
}) {};
|
|
56644
|
-
var DryRunComplete = class extends TaggedClass()("Complete", {
|
|
56646
|
+
var DryRunComplete = class extends TaggedClass()("Complete", { tests: ArraySchema(TestResultSchema) }) {};
|
|
56645
56647
|
var DryRunExternalError = class extends TaggedClass()("Error", {
|
|
56646
|
-
|
|
56648
|
+
tests: ArraySchema(TestResultSchema),
|
|
56647
56649
|
errorMessage: String$2
|
|
56648
56650
|
}) {};
|
|
56649
56651
|
//#endregion
|
|
@@ -56676,14 +56678,20 @@ function isErrorCodeError(error) {
|
|
|
56676
56678
|
return error instanceof Error && typeof Reflect.get(error, "code") === "string";
|
|
56677
56679
|
}
|
|
56678
56680
|
const VITEST_ERROR_CODES = Object.freeze({ FILES_NOT_FOUND: "VITEST_FILES_NOT_FOUND" });
|
|
56679
|
-
const
|
|
56680
|
-
const
|
|
56681
|
-
const
|
|
56682
|
-
const
|
|
56683
|
-
const
|
|
56684
|
-
const
|
|
56685
|
-
const
|
|
56686
|
-
const
|
|
56681
|
+
const isRecordValue = (value) => isObject(value);
|
|
56682
|
+
const recordOption = (value) => isRecordValue(value) ? some(value) : none();
|
|
56683
|
+
const asString = (value) => typeof value === "string";
|
|
56684
|
+
const asNumber = (value) => typeof value === "number";
|
|
56685
|
+
const asStringOption = (value) => asString(value) ? some(value) : none();
|
|
56686
|
+
const asNumberOption = (value) => asNumber(value) ? some(value) : none();
|
|
56687
|
+
const asArrayOption = (value) => Array.isArray(value) ? some(value) : none();
|
|
56688
|
+
const getStringField = (record, key) => asStringOption(record[key]);
|
|
56689
|
+
const getNumberField = (record, key) => asNumberOption(record[key]);
|
|
56690
|
+
const getSuite = (value) => flatMap$5(recordOption(value), (rec) => fromNullishOr(rec["suite"]));
|
|
56691
|
+
const getFile = (value) => flatMap$5(recordOption(value), (rec) => fromNullishOr(rec["file"]));
|
|
56692
|
+
const getResult = (value) => flatMap$5(recordOption(value), (rec) => fromNullishOr(rec["result"]));
|
|
56693
|
+
const getErrors = (value) => flatMap$5(recordOption(value), (rec) => asArrayOption(rec["errors"]));
|
|
56694
|
+
const getMessage = (value) => flatMap$5(recordOption(value), (rec) => getStringField(rec, "message"));
|
|
56687
56695
|
const getName = (value) => match$5(recordOption(value), {
|
|
56688
56696
|
onNone: () => "",
|
|
56689
56697
|
onSome: (rec) => getOrElse$1(getStringField(rec, "name"), () => "")
|
|
@@ -56692,14 +56700,26 @@ const getMode = (value) => match$5(recordOption(value), {
|
|
|
56692
56700
|
onNone: () => "run",
|
|
56693
56701
|
onSome: (rec) => getOrElse$1(getStringField(rec, "mode"), () => "run")
|
|
56694
56702
|
});
|
|
56695
|
-
const
|
|
56703
|
+
const TASK_STATES = Object.freeze({
|
|
56704
|
+
pass: "pass",
|
|
56705
|
+
fail: "fail",
|
|
56706
|
+
skip: "skip",
|
|
56707
|
+
todo: "todo",
|
|
56708
|
+
run: "run",
|
|
56709
|
+
queued: "queued",
|
|
56710
|
+
only: "only"
|
|
56711
|
+
});
|
|
56712
|
+
const getState = (value) => match$5(asStringOption(value), {
|
|
56713
|
+
onNone: () => void 0,
|
|
56714
|
+
onSome: (state) => TASK_STATES[state]
|
|
56715
|
+
});
|
|
56696
56716
|
const getDuration = (value) => match$5(recordOption(value), {
|
|
56697
56717
|
onNone: () => 0,
|
|
56698
56718
|
onSome: (rec) => getOrElse$1(getNumberField(rec, "duration"), () => 0)
|
|
56699
56719
|
});
|
|
56700
56720
|
const getFilepath = (value) => match$5(recordOption(value), {
|
|
56701
56721
|
onNone: () => void 0,
|
|
56702
|
-
onSome: (rec) => getOrUndefined$1(
|
|
56722
|
+
onSome: (rec) => getOrUndefined$1(getStringField(rec, "filepath"))
|
|
56703
56723
|
});
|
|
56704
56724
|
const collectSuiteNames = (suite) => match$5(fromNullishOr(suite), {
|
|
56705
56725
|
onNone: () => [],
|
|
@@ -56785,16 +56805,17 @@ const extractFailureMessage = (test) => match$5(getResult(test), {
|
|
|
56785
56805
|
});
|
|
56786
56806
|
const convertTestRaw = (test, projectRoot) => {
|
|
56787
56807
|
const status = extractStatus(test);
|
|
56808
|
+
const fileNameField = value(extractFileName(test)).pipe(when(void 0, () => ({})), orElse$1((fileName) => ({ fileName })));
|
|
56788
56809
|
const base = {
|
|
56789
56810
|
id: extractRawId(test, projectRoot),
|
|
56790
56811
|
name: extractName(test),
|
|
56791
56812
|
timeSpentMs: extractDuration(test),
|
|
56792
|
-
|
|
56793
|
-
|
|
56813
|
+
status,
|
|
56814
|
+
...fileNameField
|
|
56794
56815
|
};
|
|
56795
56816
|
return value(status).pipe(when("failed", () => ({
|
|
56796
56817
|
...base,
|
|
56797
|
-
status,
|
|
56818
|
+
status: "failed",
|
|
56798
56819
|
failureMessage: extractFailureMessage(test)
|
|
56799
56820
|
})), when("skipped", () => value(findSuiteErrorRaw(getOrUndefined$1(getSuite(test)))).pipe(when(defined, (suiteError) => ({
|
|
56800
56821
|
...base,
|
|
@@ -56802,20 +56823,19 @@ const convertTestRaw = (test, projectRoot) => {
|
|
|
56802
56823
|
failureMessage: suiteError
|
|
56803
56824
|
})), orElse$1(() => ({
|
|
56804
56825
|
...base,
|
|
56805
|
-
status
|
|
56826
|
+
status: "skipped"
|
|
56806
56827
|
})))), orElse$1(() => ({
|
|
56807
56828
|
...base,
|
|
56808
|
-
status
|
|
56829
|
+
status: "success"
|
|
56809
56830
|
})));
|
|
56810
56831
|
};
|
|
56811
56832
|
const decideVitestDryRun = (command) => {
|
|
56812
56833
|
const tests = command.rawTests.map((t) => convertTestRaw(t, command.projectRoot));
|
|
56813
|
-
const testsJson = JSON.stringify(tests);
|
|
56814
56834
|
const hasFailure = tests.some((t) => t.status === "failed");
|
|
56815
|
-
return value(hasFailure).pipe(when(true, () => DryRunComplete.make({
|
|
56816
|
-
|
|
56835
|
+
return value(hasFailure).pipe(when(true, () => DryRunComplete.make({ tests })), orElse$1(() => value(command.hasExternalError).pipe(when(true, () => DryRunExternalError.make({
|
|
56836
|
+
tests,
|
|
56817
56837
|
errorMessage: `An error occurred outside of a test run: ${command.externalErrorText}`
|
|
56818
|
-
})), orElse$1(() => DryRunComplete.make({
|
|
56838
|
+
})), orElse$1(() => DryRunComplete.make({ tests })))));
|
|
56819
56839
|
};
|
|
56820
56840
|
const TYPESCRIPT_SOURCE_EXTENSIONS = [
|
|
56821
56841
|
".ts",
|
|
@@ -56839,13 +56859,14 @@ const sandboxSelfAliases = (manifest, projectRoot, pathService) => match$5(named
|
|
|
56839
56859
|
onNone: () => [],
|
|
56840
56860
|
onSome: ({ name, exports: exportMap }) => Object.entries(exportMap).flatMap((entry) => toArray(exportAlias(name, projectRoot, pathService, entry)))
|
|
56841
56861
|
});
|
|
56842
|
-
const
|
|
56862
|
+
const parseJsonRecord = (text) => {
|
|
56843
56863
|
try {
|
|
56844
|
-
return JSON.parse(text);
|
|
56864
|
+
return recordOption(JSON.parse(text));
|
|
56845
56865
|
} catch {
|
|
56846
|
-
return;
|
|
56866
|
+
return none();
|
|
56847
56867
|
}
|
|
56848
56868
|
};
|
|
56869
|
+
const parseJson = (text) => getOrUndefined$1(parseJsonRecord(text));
|
|
56849
56870
|
const readSandboxSelfAliases = (projectRoot) => gen(function* () {
|
|
56850
56871
|
const fs = yield* FileSystem;
|
|
56851
56872
|
const pathService = yield* Path$1;
|
|
@@ -56909,7 +56930,11 @@ const runFilterPlan = (filter, projectRoot, pathService) => {
|
|
|
56909
56930
|
};
|
|
56910
56931
|
const isMissingTestFilesCause = (cause) => value(isErrorCodeError(cause)).pipe(when(true, () => typeof cause === "string" && cause.includes(VITEST_ERROR_CODES.FILES_NOT_FOUND)), orElse$1(() => false));
|
|
56911
56932
|
const experimentalStateGetFiles = (vitest) => vitest.state.getFiles();
|
|
56912
|
-
const
|
|
56933
|
+
const isOpaqueRecord = (value) => isObject(value);
|
|
56934
|
+
const propertyOf = (value, key) => {
|
|
56935
|
+
if (!isOpaqueRecord(value)) return none();
|
|
56936
|
+
return fromNullishOr(value[key]);
|
|
56937
|
+
};
|
|
56913
56938
|
const vitestStateOf = (vitest) => propertyOf(vitest, "state");
|
|
56914
56939
|
const errorsSetOf = (vitest) => flatMap$5(vitestStateOf(vitest), (state) => propertyOf(state, "errorsSet"));
|
|
56915
56940
|
const invokeMethod = (holder, name) => match$5(filter(propertyOf(holder, name), isFunction), {
|
|
@@ -56929,18 +56954,21 @@ const entryCountOf = (collection) => value(collection).pipe(when(instanceOf(Set)
|
|
|
56929
56954
|
const experimentalStateHasExternalErrors = (vitest) => exists(flatMap$5(errorsSetOf(vitest), entryCountOf), (count) => count > 0);
|
|
56930
56955
|
const experimentalStateGetExternalErrorText = (vitest) => match$5(errorsSetOf(vitest), {
|
|
56931
56956
|
onNone: () => "",
|
|
56932
|
-
onSome: (errorsSet) =>
|
|
56957
|
+
onSome: (errorsSet) => isIterable(errorsSet) ? [...errorsSet].map(errorToString).join("\n") : ""
|
|
56933
56958
|
});
|
|
56934
|
-
const
|
|
56935
|
-
|
|
56959
|
+
const isMutantActivation = (value) => value === "runtime" || value === "static";
|
|
56960
|
+
const applyMutantActivation = (ctx, value) => {
|
|
56961
|
+
if (isMutantActivation(value)) ctx.provide("mutantActivation", value);
|
|
56962
|
+
};
|
|
56963
|
+
const applyActiveMutant = (ctx, value) => {
|
|
56964
|
+
if (isString(value)) ctx.provide("activeMutant", value);
|
|
56965
|
+
};
|
|
56966
|
+
const applyHarnessValue = (ctx, key, value$4) => value(key).pipe(when("hitLimit", () => {
|
|
56967
|
+
ctx.provide("hitLimit", getOrUndefined$1(filter(fromNullishOr(value$4), isNumber)));
|
|
56936
56968
|
}), when("mutantActivation", () => {
|
|
56937
|
-
|
|
56938
|
-
ctx.provide("mutantActivation", activation);
|
|
56939
|
-
}), orElse$1(() => void 0));
|
|
56969
|
+
applyMutantActivation(ctx, value$4);
|
|
56940
56970
|
}), orElse$1(() => {
|
|
56941
|
-
|
|
56942
|
-
ctx.provide("activeMutant", activeMutant);
|
|
56943
|
-
}), orElse$1(() => void 0));
|
|
56971
|
+
applyActiveMutant(ctx, value$4);
|
|
56944
56972
|
}));
|
|
56945
56973
|
const applyRunFilterToConfig = (vitest, options) => sync(() => {
|
|
56946
56974
|
vitest.config.related = options.related;
|
|
@@ -56952,7 +56980,10 @@ const disableScreenshotFailures = (value) => match$5(filter(fromNullishOr(value)
|
|
|
56952
56980
|
Reflect.set(browser, "screenshotFailures", false);
|
|
56953
56981
|
}
|
|
56954
56982
|
});
|
|
56955
|
-
const setupFilePathsOf = (value
|
|
56983
|
+
const setupFilePathsOf = (value) => {
|
|
56984
|
+
if (Array.isArray(value)) return value.filter((v) => typeof v === "string");
|
|
56985
|
+
return [];
|
|
56986
|
+
};
|
|
56956
56987
|
const applySetupFilesToProjects = (vitest, localSetupFile) => {
|
|
56957
56988
|
disableScreenshotFailures(Reflect.get(vitest.config, "browser"));
|
|
56958
56989
|
for (const project of vitest.projects) {
|
|
@@ -57086,7 +57117,7 @@ const makeVitestRunnerLayer = (input) => effect(TestRunner, gen(function* () {
|
|
|
57086
57117
|
ctx
|
|
57087
57118
|
}));
|
|
57088
57119
|
}).pipe(mapError$1((cause) => (() => {
|
|
57089
|
-
if (is
|
|
57120
|
+
if (is(TestRunnerFailed)(cause)) return cause;
|
|
57090
57121
|
return new TestRunnerFailed({
|
|
57091
57122
|
runnerName: "vitest",
|
|
57092
57123
|
phase: "init",
|
|
@@ -57154,16 +57185,24 @@ const makeVitestRunnerLayer = (input) => effect(TestRunner, gen(function* () {
|
|
|
57154
57185
|
phase: "dryRun",
|
|
57155
57186
|
cause: errorToString(cause)
|
|
57156
57187
|
})
|
|
57157
|
-
}).pipe(catchIf((error) => isMissingTestFilesCause(error.cause), () =>
|
|
57158
|
-
|
|
57188
|
+
}).pipe(catchIf((error) => isMissingTestFilesCause(error.cause), () => annotateCurrentSpan({ "stryker.vitest.start_missing_files": true }).pipe(asVoid)), catchIf((error) => !isMissingTestFilesCause(error.cause), (error) => annotateCurrentSpan({ "stryker.vitest.start_errored": true }).pipe(flatMap(() => fail$1(error)))));
|
|
57189
|
+
yield* annotateCurrentSpan({ "stryker.vitest.start_filter_count": plan.testFiles === void 0 ? -1 : plan.testFiles.length });
|
|
57190
|
+
const allFiles = experimentalStateGetFiles(ctx);
|
|
57191
|
+
const rawTests = allFiles.flatMap((file) => (() => {
|
|
57159
57192
|
if (isRunnerTestSuite(file)) return collectTestsFromSuite(file);
|
|
57160
57193
|
return [];
|
|
57161
57194
|
})()).filter((test) => test.result !== void 0);
|
|
57162
57195
|
const hasExternalError = experimentalStateHasExternalErrors(ctx);
|
|
57196
|
+
const externalErrorText = value(hasExternalError).pipe(when(true, () => experimentalStateGetExternalErrorText(ctx)), orElse$1(() => ""));
|
|
57197
|
+
yield* annotateCurrentSpan({
|
|
57198
|
+
"stryker.vitest.file_count": allFiles.length,
|
|
57199
|
+
"stryker.vitest.raw_test_count": rawTests.length,
|
|
57200
|
+
"stryker.vitest.has_external_error": hasExternalError
|
|
57201
|
+
});
|
|
57163
57202
|
return {
|
|
57164
57203
|
rawTests,
|
|
57165
57204
|
hasExternalError,
|
|
57166
|
-
externalErrorText
|
|
57205
|
+
externalErrorText
|
|
57167
57206
|
};
|
|
57168
57207
|
});
|
|
57169
57208
|
const harnessImpl = {
|
|
@@ -57220,7 +57259,7 @@ const makeVitestRunnerLayer = (input) => effect(TestRunner, gen(function* () {
|
|
|
57220
57259
|
errorMessage: e.message
|
|
57221
57260
|
}),
|
|
57222
57261
|
onSuccess: (out) => {
|
|
57223
|
-
const nrOfTests = () =>
|
|
57262
|
+
const nrOfTests = () => out.tests.length;
|
|
57224
57263
|
return value(out).pipe(tag("Error", (error) => ({
|
|
57225
57264
|
status: "error",
|
|
57226
57265
|
errorMessage: error.errorMessage ?? "unknown"
|
|
@@ -57251,13 +57290,16 @@ const makeVitestRunnerLayer = (input) => effect(TestRunner, gen(function* () {
|
|
|
57251
57290
|
relatedFiles
|
|
57252
57291
|
})), orElse$1(() => ({ relatedFiles })));
|
|
57253
57292
|
};
|
|
57254
|
-
const completeDryRun = (
|
|
57255
|
-
const tests = value(parseJson(testsJson)).pipe(when(Array.isArray, (entries) => entries.filter(isTestResultLike)), orElse$1(() => []));
|
|
57293
|
+
const completeDryRun = (tests) => gen(function* () {
|
|
57256
57294
|
const mutantCoverage = yield* readMutantCoverage.pipe(mapError$1((cause) => new TestRunnerFailed({
|
|
57257
57295
|
runnerName: "vitest",
|
|
57258
57296
|
phase: "dryRun",
|
|
57259
57297
|
cause: errorToString(cause)
|
|
57260
57298
|
})));
|
|
57299
|
+
yield* annotateCurrentSpan({
|
|
57300
|
+
"stryker.vitest.test_count": tests.length,
|
|
57301
|
+
"stryker.vitest.has_mutant_coverage": mutantCoverage !== void 0
|
|
57302
|
+
});
|
|
57261
57303
|
return value(mutantCoverage).pipe(when(defined, (coverage) => ({
|
|
57262
57304
|
status: "complete",
|
|
57263
57305
|
tests,
|
|
@@ -57280,9 +57322,9 @@ const makeVitestRunnerLayer = (input) => effect(TestRunner, gen(function* () {
|
|
|
57280
57322
|
return yield* value(decision).pipe(tag("Error", (error) => succeed$1({
|
|
57281
57323
|
status: "error",
|
|
57282
57324
|
errorMessage: error.errorMessage
|
|
57283
|
-
})), tag("Complete", (complete) => completeDryRun(complete.
|
|
57325
|
+
})), tag("Complete", (complete) => completeDryRun(complete.tests)), exhaustive);
|
|
57284
57326
|
}).pipe(provideService(VitestHarness, harnessImpl), mapError$1((cause) => (() => {
|
|
57285
|
-
if (is
|
|
57327
|
+
if (is(TestRunnerFailed)(cause)) return cause;
|
|
57286
57328
|
return new TestRunnerFailed({
|
|
57287
57329
|
runnerName: "vitest",
|
|
57288
57330
|
phase: "dryRun",
|
|
@@ -57290,7 +57332,7 @@ const makeVitestRunnerLayer = (input) => effect(TestRunner, gen(function* () {
|
|
|
57290
57332
|
});
|
|
57291
57333
|
})()));
|
|
57292
57334
|
const mutantRun = (options) => mutantRunCell.run(options).pipe(provideService(VitestHarness, harnessImpl), mapError$1((cause) => (() => {
|
|
57293
|
-
if (is
|
|
57335
|
+
if (is(TestRunnerFailed)(cause)) return cause;
|
|
57294
57336
|
return new TestRunnerFailed({
|
|
57295
57337
|
runnerName: "vitest",
|
|
57296
57338
|
phase: "mutantRun",
|
|
@@ -57333,12 +57375,6 @@ const makeVitestRunnerLayer = (input) => effect(TestRunner, gen(function* () {
|
|
|
57333
57375
|
dispose
|
|
57334
57376
|
});
|
|
57335
57377
|
}));
|
|
57336
|
-
function isTestResultLike(value) {
|
|
57337
|
-
return isObject(value) && typeof value["id"] === "string";
|
|
57338
|
-
}
|
|
57339
|
-
function countIdRecords(raw) {
|
|
57340
|
-
return value(raw).pipe(when(Array.isArray, (entries) => entries.filter(isTestResultLike).length), orElse$1(() => 0));
|
|
57341
|
-
}
|
|
57342
57378
|
const mergeHitCount = (to, mutantId, hitCount) => match$5(fromNullishOr(to[mutantId]), {
|
|
57343
57379
|
onNone: () => {
|
|
57344
57380
|
to[mutantId] = hitCount;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-js-vitest-runner",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@effect/vitest": "4.0.0-rc.116",
|
|
48
48
|
"@microsoft/api-extractor": "^7",
|
|
49
49
|
"@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
|
|
50
|
-
"@systemfsoftware/effect-gherkin-spec": "^4.2.
|
|
51
|
-
"@systemfsoftware/oxlint-config-recommended": "^1.
|
|
50
|
+
"@systemfsoftware/effect-gherkin-spec": "^4.2.2",
|
|
51
|
+
"@systemfsoftware/oxlint-config-recommended": "^1.1.0",
|
|
52
52
|
"@systemfsoftware/stryker-ignorer-effect-schema-declarations": "latest",
|
|
53
53
|
"@systemfsoftware/stryker-ignorer-in-source-vitest-block": "latest",
|
|
54
54
|
"@systemfsoftware/stryker-js": "latest",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"typescript": "^7",
|
|
67
67
|
"vitest": "^5",
|
|
68
68
|
"@systemfsoftware/stryker-config": "^0.1.0",
|
|
69
|
-
"@systemfsoftware/stryker-js-instrumenter": "^8.0.
|
|
70
|
-
"@systemfsoftware/stryker-js-plugin-interface": "^7.2.
|
|
69
|
+
"@systemfsoftware/stryker-js-instrumenter": "^8.0.2",
|
|
70
|
+
"@systemfsoftware/stryker-js-plugin-interface": "^7.2.1",
|
|
71
71
|
"@systemfsoftware/stryker-js-plugin-runtime": "^5.0.3",
|
|
72
|
-
"@systemfsoftware/
|
|
73
|
-
"@systemfsoftware/
|
|
72
|
+
"@systemfsoftware/vitest-config": "^0.1.0",
|
|
73
|
+
"@systemfsoftware/tsdown-config": "^0.1.0"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"provenance": true
|