@hardkas/testing 0.6.0-alpha → 0.7.0-alpha
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/dist/adversarial-fixtures.js +1 -0
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/harness.js +1 -0
- package/dist/index.d.ts +71 -1
- package/dist/index.js +3666 -0
- package/dist/mass-setup.js +1 -0
- package/dist/reproducibility.js +1 -0
- package/dist/setup.js +1 -0
- package/package.json +11 -10
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__require
|
|
10
|
+
};
|
package/dist/harness.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -97,4 +97,74 @@ declare const hardKasMatchers: {
|
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
declare class LcgPrng {
|
|
101
|
+
private state;
|
|
102
|
+
constructor(seed: number);
|
|
103
|
+
/** Returns a float between 0 (inclusive) and 1 (exclusive) */
|
|
104
|
+
next(): number;
|
|
105
|
+
/** Returns an integer between min (inclusive) and max (inclusive) */
|
|
106
|
+
nextInt(min: number, max: number): number;
|
|
107
|
+
/** Pick a random element from an array */
|
|
108
|
+
pick<T>(arr: T[]): T;
|
|
109
|
+
/** Deterministic shuffle */
|
|
110
|
+
shuffle<T>(arr: T[]): T[];
|
|
111
|
+
}
|
|
112
|
+
type TortureCaseResult = {
|
|
113
|
+
caseId: string;
|
|
114
|
+
seed: number;
|
|
115
|
+
bucket: string;
|
|
116
|
+
flow: string;
|
|
117
|
+
mutation: string;
|
|
118
|
+
expectedInvariant: string;
|
|
119
|
+
status: "pass" | "fail";
|
|
120
|
+
failureReason?: string;
|
|
121
|
+
failureCode?: string;
|
|
122
|
+
severity?: "info" | "warning" | "critical" | "catastrophic";
|
|
123
|
+
reproduceCommand: string;
|
|
124
|
+
artifactsBefore?: string[];
|
|
125
|
+
artifactsAfter?: string[];
|
|
126
|
+
environmentMode?: string;
|
|
127
|
+
filesystemMode?: string;
|
|
128
|
+
symlinkMode?: string;
|
|
129
|
+
normalizedPathStrategy?: string;
|
|
130
|
+
clockSkewDetected?: boolean;
|
|
131
|
+
externalMutationDetected?: boolean;
|
|
132
|
+
longPathSupportDetected?: boolean;
|
|
133
|
+
sandboxSnapshotPath?: string;
|
|
134
|
+
};
|
|
135
|
+
interface TortureBucketContext {
|
|
136
|
+
globalSeed: number;
|
|
137
|
+
caseSeed: number;
|
|
138
|
+
caseId: string;
|
|
139
|
+
prng: LcgPrng;
|
|
140
|
+
workspaceDir: string;
|
|
141
|
+
}
|
|
142
|
+
type TortureBucketRunner = (ctx: TortureBucketContext) => Promise<{
|
|
143
|
+
flow: string;
|
|
144
|
+
mutation: string;
|
|
145
|
+
expectedInvariant?: string;
|
|
146
|
+
artifactsBefore?: string[];
|
|
147
|
+
artifactsAfter?: string[];
|
|
148
|
+
environmentMode?: string;
|
|
149
|
+
filesystemMode?: string;
|
|
150
|
+
symlinkMode?: string;
|
|
151
|
+
normalizedPathStrategy?: string;
|
|
152
|
+
clockSkewDetected?: boolean;
|
|
153
|
+
externalMutationDetected?: boolean;
|
|
154
|
+
longPathSupportDetected?: boolean;
|
|
155
|
+
}>;
|
|
156
|
+
interface TortureBucket {
|
|
157
|
+
name: string;
|
|
158
|
+
expectedInvariant: string;
|
|
159
|
+
profiles?: string[];
|
|
160
|
+
run: TortureBucketRunner;
|
|
161
|
+
}
|
|
162
|
+
declare function getTortureBucket(name: string): TortureBucket | undefined;
|
|
163
|
+
declare function getAllTortureBuckets(): TortureBucket[];
|
|
164
|
+
declare class TortureInvariantError extends Error {
|
|
165
|
+
code: string;
|
|
166
|
+
severity: "info" | "warning" | "critical" | "catastrophic";
|
|
167
|
+
constructor(message: string, code: string, severity?: "info" | "warning" | "critical" | "catastrophic");
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export { type FixtureDefinition, type HardKasMatchers, LcgPrng, TestHarness, type TortureBucket, type TortureBucketContext, type TortureCaseResult, TortureInvariantError, createFixture, getAllTortureBuckets, getTortureBucket, hardKasMatchers };
|