Lines 24-64javascript
24 registerAfterEach?.(() => {
25 flushPendingAssertions();
29function flushPendingAssertions() {
30 const ctx = activeContext;
32 const step = ctx.pendingStep;
33 const before = ctx.pendingFrom;
34 ctx.pendingStep = null;
35 ctx.pendingFrom = void 0;
37 recordAssertions(step, before);
39var featureRegistry = /* @__PURE__ */ new Map();
40var storyRegistry = globalThis.__jestExecutableStoriesRegistry ??= /* @__PURE__ */ new Map();
41var attachmentRegistry = /* @__PURE__ */ new Map();
42var otelSpansRegistry = /* @__PURE__ */ new Map();
43var exitHandlerRegistered = globalThis.__jestExecutableStoriesExitHandler ?? false;
44function getOutputDir() {
45 const baseDir = process.env.JEST_STORY_DOCS_DIR ?? ".jest-executable-stories";
46 return path.resolve(process.cwd(), baseDir);
47}
LowWeak Crypto
Package source references weak cryptographic algorithms.
dist/index.jsView on unpkg · L44 48function flushStories() {
49 if (storyRegistry.size === 0) return;
50 const workerId = process.env.JEST_WORKER_ID ?? "0";
51 const outputDir = path.join(getOutputDir(), `worker-${workerId}`);
52 fs.mkdirSync(outputDir, { recursive: true });
53 for (const [testFilePath, scenarios] of storyRegistry) {
54 if (!scenarios.length) continue;
55 const hash = createHash("sha1").update(testFilePath).digest("hex").slice(0, 12);
56 const baseName = testFilePath === "unknown" ? "unknown" : path.basename(testFilePath);
57 const outFile = path.join(outputDir, `${baseName}.${hash}.json`);
58 const fileAttachments = attachmentRegistry.get(testFilePath);
59 const fileOtelSpans = otelSpansRegistry.get(testFilePath);
60 const scenariosWithAttachments = scenarios.map((s, i) => ({
62 _attachments: fileAttachments?.get(i) ?? [],
63 ...fileOtelSpans?.get(i) ? { _otelSpans: fileOtelSpans.get(i) } : {}