mirror of
https://github.com/morluto/rea.git
synced 2026-12-02 11:33:10 +00:00
test(javascript): share worker source fixtures (#15606)
This commit is contained in:
1 parent
c04b064945
commit
90c07a92d7
7 files changed
+28
-78
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { execFile } from "node:child_process";
|
||||
import { readFile, readdir } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
@@ -19,18 +18,7 @@ import { JAVASCRIPT_MEMBER_MUTATION_WORK_LIMIT } from "../../../src/domain/javas
|
||||
import { projectAnalysisError } from "../../../src/domain/analysisErrorProjection.js";
|
||||
import { spawnOwnedProviderProcess } from "../../../src/process/ProviderProcess.js";
|
||||
import { javaScriptWorkerMemoryLimitBytes } from "../../../src/process/JavaScriptWorkerMemoryLimit.js";
|
||||
import type { JavaScriptArtifactFile } from "../../../src/domain/javascript/javascriptArtifactFiles.js";
|
||||
|
||||
const source = (path: string, value: string): JavaScriptArtifactFile => ({
|
||||
path,
|
||||
sha256: createHash("sha256").update(value).digest("hex"),
|
||||
container_sha256: "1".repeat(64),
|
||||
bytes: Buffer.byteLength(value),
|
||||
inventory_artifact_id: "fixture-source",
|
||||
kind: "javascript",
|
||||
unpacked: false,
|
||||
text: { included: true, value },
|
||||
});
|
||||
import { javaScriptWorkerSource as source } from "../../fixtures/javascriptWorkerSource.js";
|
||||
|
||||
/** The Job Object limit the worker requests for its 128 MiB heap budget, if any. */
|
||||
const processLimit = javaScriptWorkerMemoryLimitBytes(128);
|
||||
|
||||
Reference in new issue
Block a user