@isentinel/jest-roblox 0.3.5 → 0.3.6
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/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{run-DbEgZMyU.mjs → run-C4GuftZH.mjs} +25 -25
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as loadConfig, D as outputMultiResult, H as formatBanner, O as outputSingleResult, P as parseGameOutput, Q as mergeCliWithConfig, Y as LuauScriptError, dt as version, f as formatMissingScopes, lt as isValidBackend, n as runJestRoblox, ot as VALID_BACKENDS, p as walkErrorChain, ut as ConfigError } from "./run-
|
|
1
|
+
import { $ as loadConfig, D as outputMultiResult, H as formatBanner, O as outputSingleResult, P as parseGameOutput, Q as mergeCliWithConfig, Y as LuauScriptError, dt as version, f as formatMissingScopes, lt as isValidBackend, n as runJestRoblox, ot as VALID_BACKENDS, p as walkErrorChain, ut as ConfigError } from "./run-C4GuftZH.mjs";
|
|
2
2
|
import { OpenCloudError } from "@bedrock-rbx/ocale";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { parseArgs as parseArgs$1 } from "node:util";
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as loadConfig, A as formatJobSummary, B as formatResult, C as BUILD_MANIFEST_VERSION, E as readBuildManifest, F as writeGameOutput, G as manifestSchema, I as createTimingCollector, J as applyAttribution, K as readManifest, L as formatJson, M as runProjects, N as formatGameOutputNotice, P as parseGameOutput, Q as mergeCliWithConfig, R as writeJsonFile, S as buildPlace, T as emitBuildManifest, U as hashFile, V as formatTestSummary, W as MANIFEST_VERSION, X as extractJsonFromOutput, Z as parseJestOutput, _ as COVERAGE_MANIFEST_PATH, a as loadRojoTree, at as SHARED_TEST_KEYS, b as visitExpression, c as StudioBackend, ct as defineProject, d as createOpenCloudBackend, et as resolveConfig, g as COVERAGE_BUILD_MANIFEST_PATH, h as generateTestScript, i as collectStubMounts, it as ROOT_CLI_KEYS, j as formatExecuteOutput, k as formatAnnotations, l as createStudioBackend, m as buildJestArgv, n as runJestRoblox, nt as GLOBAL_TEST_KEYS, o as runTypecheck, q as writeManifest, r as runSingleOrMulti, rt as JEST_ARGV_EXCLUDED_KEYS, s as resolveAllProjects, st as defineConfig, t as getRawProjects, tt as DEFAULT_CONFIG, u as OpenCloudBackend, v as findRojoProject, w as buildManifestSchema, x as visitStatement, y as visitBlock, z as formatFailure } from "./run-
|
|
1
|
+
import { $ as loadConfig, A as formatJobSummary, B as formatResult, C as BUILD_MANIFEST_VERSION, E as readBuildManifest, F as writeGameOutput, G as manifestSchema, I as createTimingCollector, J as applyAttribution, K as readManifest, L as formatJson, M as runProjects, N as formatGameOutputNotice, P as parseGameOutput, Q as mergeCliWithConfig, R as writeJsonFile, S as buildPlace, T as emitBuildManifest, U as hashFile, V as formatTestSummary, W as MANIFEST_VERSION, X as extractJsonFromOutput, Z as parseJestOutput, _ as COVERAGE_MANIFEST_PATH, a as loadRojoTree, at as SHARED_TEST_KEYS, b as visitExpression, c as StudioBackend, ct as defineProject, d as createOpenCloudBackend, et as resolveConfig, g as COVERAGE_BUILD_MANIFEST_PATH, h as generateTestScript, i as collectStubMounts, it as ROOT_CLI_KEYS, j as formatExecuteOutput, k as formatAnnotations, l as createStudioBackend, m as buildJestArgv, n as runJestRoblox, nt as GLOBAL_TEST_KEYS, o as runTypecheck, q as writeManifest, r as runSingleOrMulti, rt as JEST_ARGV_EXCLUDED_KEYS, s as resolveAllProjects, st as defineConfig, t as getRawProjects, tt as DEFAULT_CONFIG, u as OpenCloudBackend, v as findRojoProject, w as buildManifestSchema, x as visitStatement, y as visitBlock, z as formatFailure } from "./run-C4GuftZH.mjs";
|
|
2
2
|
import * as path$1 from "node:path";
|
|
3
3
|
//#region src/artifacts/prepare-artifacts.ts
|
|
4
4
|
const COVERAGE_DIR = path$1.dirname(COVERAGE_BUILD_MANIFEST_PATH);
|
|
@@ -34,7 +34,7 @@ import { StorageClient } from "@bedrock-rbx/ocale/storage";
|
|
|
34
34
|
import { parseJSONC, parseYAML } from "confbox";
|
|
35
35
|
import { Visitor, parseSync } from "oxc-parser";
|
|
36
36
|
//#region package.json
|
|
37
|
-
var version = "0.3.
|
|
37
|
+
var version = "0.3.6";
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/config/errors.ts
|
|
40
40
|
var ConfigError = class extends Error {
|
|
@@ -46,7 +46,7 @@ var ConfigError = class extends Error {
|
|
|
46
46
|
};
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/config/schema.ts
|
|
49
|
-
const VALID_BACKENDS = new Set([
|
|
49
|
+
const VALID_BACKENDS = /* @__PURE__ */ new Set([
|
|
50
50
|
"auto",
|
|
51
51
|
"open-cloud",
|
|
52
52
|
"studio"
|
|
@@ -336,7 +336,7 @@ const PROJECT_TEST_KEYS = new Set(PROJECT_TEST_KEYS_LIST);
|
|
|
336
336
|
* by config shape but are consumed by the runner's lute-based coverage layer
|
|
337
337
|
* (not jest itself).
|
|
338
338
|
*/
|
|
339
|
-
const JEST_ARGV_EXCLUDED_KEYS = new Set([
|
|
339
|
+
const JEST_ARGV_EXCLUDED_KEYS = /* @__PURE__ */ new Set([
|
|
340
340
|
...ROOT_CLI_KEYS_LIST,
|
|
341
341
|
"collectCoverage",
|
|
342
342
|
"collectCoverageFrom",
|
|
@@ -510,7 +510,7 @@ async function processExtends(result, visited) {
|
|
|
510
510
|
visited.delete(canonicalFile);
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
const EMPTY_ARRAY_DEFAULT_KEYS = new Set([
|
|
513
|
+
const EMPTY_ARRAY_DEFAULT_KEYS = /* @__PURE__ */ new Set([
|
|
514
514
|
"collectCoverageFrom",
|
|
515
515
|
"formatters",
|
|
516
516
|
"luauRoots",
|
|
@@ -521,8 +521,8 @@ const EMPTY_ARRAY_DEFAULT_KEYS = new Set([
|
|
|
521
521
|
"setupFilesAfterEnv",
|
|
522
522
|
"snapshotSerializers"
|
|
523
523
|
]);
|
|
524
|
-
const EMPTY_OBJECT_DEFAULT_KEYS = new Set(["coverageThreshold", "snapshotFormat"]);
|
|
525
|
-
const MERGEABLE_KEYS = new Set([
|
|
524
|
+
const EMPTY_OBJECT_DEFAULT_KEYS = /* @__PURE__ */ new Set(["coverageThreshold", "snapshotFormat"]);
|
|
525
|
+
const MERGEABLE_KEYS = /* @__PURE__ */ new Set([
|
|
526
526
|
...EMPTY_ARRAY_DEFAULT_KEYS,
|
|
527
527
|
...EMPTY_OBJECT_DEFAULT_KEYS,
|
|
528
528
|
"coveragePathIgnorePatterns",
|
|
@@ -1043,7 +1043,7 @@ function populateBranches(file, fileBranches) {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
function buildResult(pending, pendingFunctions, pendingBranches) {
|
|
1045
1045
|
const files = {};
|
|
1046
|
-
const allPaths = new Set([
|
|
1046
|
+
const allPaths = /* @__PURE__ */ new Set([
|
|
1047
1047
|
...pending.keys(),
|
|
1048
1048
|
...pendingFunctions.keys(),
|
|
1049
1049
|
...pendingBranches.keys()
|
|
@@ -1141,7 +1141,7 @@ function createGlobMatcher(patterns) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
//#endregion
|
|
1143
1143
|
//#region src/coverage-pipeline/reporter.ts
|
|
1144
|
-
const VALID_REPORTERS = new Set([
|
|
1144
|
+
const VALID_REPORTERS = /* @__PURE__ */ new Set([
|
|
1145
1145
|
"clover",
|
|
1146
1146
|
"cobertura",
|
|
1147
1147
|
"html",
|
|
@@ -1160,7 +1160,7 @@ function printCoverageHeader() {
|
|
|
1160
1160
|
const header = ` ${color.blue("%")} ${color.dim("Coverage report from")} ${color.yellow("istanbul")}`;
|
|
1161
1161
|
process.stdout.write(`\n${header}\n`);
|
|
1162
1162
|
}
|
|
1163
|
-
const TEXT_REPORTERS = new Set(["text", "text-summary"]);
|
|
1163
|
+
const TEXT_REPORTERS = /* @__PURE__ */ new Set(["text", "text-summary"]);
|
|
1164
1164
|
function generateReports(options) {
|
|
1165
1165
|
const coverageMap = buildCoverageMap$2(filterCoverageUniverse(options.mapped, {
|
|
1166
1166
|
ignore: options.coveragePathIgnorePatterns,
|
|
@@ -1463,12 +1463,12 @@ function findInTree(node, targetPath, currentDataModelPath) {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
const LUA_EXT = ".lua";
|
|
1465
1465
|
const LUAU_EXT = ".luau";
|
|
1466
|
-
const ROJO_MODULE_EXTS = new Set([
|
|
1466
|
+
const ROJO_MODULE_EXTS = /* @__PURE__ */ new Set([
|
|
1467
1467
|
".json",
|
|
1468
1468
|
LUAU_EXT,
|
|
1469
1469
|
".toml"
|
|
1470
1470
|
]);
|
|
1471
|
-
const ROJO_SCRIPT_EXTS = new Set([LUAU_EXT]);
|
|
1471
|
+
const ROJO_SCRIPT_EXTS = /* @__PURE__ */ new Set([LUAU_EXT]);
|
|
1472
1472
|
const INIT_NAME = "init";
|
|
1473
1473
|
const SERVER_SUB_EXTENSION = ".server";
|
|
1474
1474
|
const CLIENT_SUB_EXTENSION = ".client";
|
|
@@ -1482,7 +1482,7 @@ const RbxType = {
|
|
|
1482
1482
|
Script: 1,
|
|
1483
1483
|
Unknown: 3
|
|
1484
1484
|
};
|
|
1485
|
-
const SUB_EXT_TYPE_MAP = new Map([
|
|
1485
|
+
const SUB_EXT_TYPE_MAP = /* @__PURE__ */ new Map([
|
|
1486
1486
|
[CLIENT_SUB_EXTENSION, RbxType.LocalScript],
|
|
1487
1487
|
[MODULE_SUB_EXTENSION, RbxType.ModuleScript],
|
|
1488
1488
|
[SERVER_SUB_EXTENSION, RbxType.Script]
|
|
@@ -2207,10 +2207,10 @@ function deriveStatic(cumulative, coveringTestIds) {
|
|
|
2207
2207
|
}
|
|
2208
2208
|
function mergeStatic(a, b, coveringTestIds) {
|
|
2209
2209
|
const merged = {};
|
|
2210
|
-
const fileKeys = new Set([...Object.keys(a), ...Object.keys(b)]);
|
|
2210
|
+
const fileKeys = /* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)]);
|
|
2211
2211
|
for (const fileKey of fileKeys) {
|
|
2212
2212
|
const credited = coveringTestIds[fileKey];
|
|
2213
|
-
const ids = [
|
|
2213
|
+
const ids = [.../* @__PURE__ */ new Set([...a[fileKey] ?? [], ...b[fileKey] ?? []])].filter((statementId) => credited?.[statementId] === void 0).sort((first, second) => Number(first) - Number(second));
|
|
2214
2214
|
if (ids.length > 0) merged[fileKey] = ids;
|
|
2215
2215
|
}
|
|
2216
2216
|
return merged;
|
|
@@ -2778,7 +2778,7 @@ const TS_SUPPORTED_EXTS = new Set(["js", "ts"].flatMap((lang) => [
|
|
|
2778
2778
|
`.m${lang}x`,
|
|
2779
2779
|
`.c${lang}x`
|
|
2780
2780
|
]));
|
|
2781
|
-
const LUAU_SUPPORTED_EXTS = new Set([".lua", ".luau"]);
|
|
2781
|
+
const LUAU_SUPPORTED_EXTS = /* @__PURE__ */ new Set([".lua", ".luau"]);
|
|
2782
2782
|
function highlightCode(id, source) {
|
|
2783
2783
|
const extension = extname(id);
|
|
2784
2784
|
if (LUAU_SUPPORTED_EXTS.has(extension)) return highlightLuau(source);
|
|
@@ -5300,7 +5300,7 @@ function redirectPathToShadow(target, coverageRoots) {
|
|
|
5300
5300
|
//#region src/staging/synthesizer.ts
|
|
5301
5301
|
const STUB_INJECTION_KEY = "jest.config";
|
|
5302
5302
|
const COLLIDING_SOURCE_FILES = ["jest.config.lua", "jest.config.luau"];
|
|
5303
|
-
const SERVICE_CLASSES = new Set([
|
|
5303
|
+
const SERVICE_CLASSES = /* @__PURE__ */ new Set([
|
|
5304
5304
|
"Chat",
|
|
5305
5305
|
"CollectionService",
|
|
5306
5306
|
"DataModel",
|
|
@@ -5326,7 +5326,7 @@ const SERVICE_CLASSES = new Set([
|
|
|
5326
5326
|
"UserInputService",
|
|
5327
5327
|
"Workspace"
|
|
5328
5328
|
]);
|
|
5329
|
-
const SERVICE_PROPERTIES = new Set([
|
|
5329
|
+
const SERVICE_PROPERTIES = /* @__PURE__ */ new Set([
|
|
5330
5330
|
"AutoRuns",
|
|
5331
5331
|
"ExecuteWithStudioRun",
|
|
5332
5332
|
"LoadStringEnabled"
|
|
@@ -5800,7 +5800,7 @@ function visitExprInstantiate(node, visitor) {
|
|
|
5800
5800
|
}
|
|
5801
5801
|
//#endregion
|
|
5802
5802
|
//#region src/coverage-pipeline/coverage-collector.ts
|
|
5803
|
-
const INSTRUMENTABLE_STATEMENT_TAGS = new Set([
|
|
5803
|
+
const INSTRUMENTABLE_STATEMENT_TAGS = /* @__PURE__ */ new Set([
|
|
5804
5804
|
"assign",
|
|
5805
5805
|
"break",
|
|
5806
5806
|
"compoundassign",
|
|
@@ -6286,7 +6286,7 @@ function computeRojoInputsHash(options) {
|
|
|
6286
6286
|
const mounts = [];
|
|
6287
6287
|
collectPaths(tree, mounts);
|
|
6288
6288
|
const luauRootKeys = luauRoots.map((root) => toKey(path$1.join(rootDirectory, root)));
|
|
6289
|
-
const files = new Set([toKey(rojoProjectPath)]);
|
|
6289
|
+
const files = /* @__PURE__ */ new Set([toKey(rojoProjectPath)]);
|
|
6290
6290
|
for (const projectFile of projectFiles) files.add(toKey(projectFile));
|
|
6291
6291
|
const visitedDirectories = /* @__PURE__ */ new Set();
|
|
6292
6292
|
for (const mount of mounts) {
|
|
@@ -7684,7 +7684,7 @@ function getTemporaryDirectory() {
|
|
|
7684
7684
|
//#endregion
|
|
7685
7685
|
//#region src/config/projects.ts
|
|
7686
7686
|
function extractStaticRoot(pattern) {
|
|
7687
|
-
const globChars = new Set([
|
|
7687
|
+
const globChars = /* @__PURE__ */ new Set([
|
|
7688
7688
|
"*",
|
|
7689
7689
|
"?",
|
|
7690
7690
|
"[",
|
|
@@ -7762,7 +7762,7 @@ function validateProjects(projects) {
|
|
|
7762
7762
|
if (project.include.length === 0) throw new Error(`Project "${name}" must have at least one include pattern`);
|
|
7763
7763
|
}
|
|
7764
7764
|
}
|
|
7765
|
-
const PROJECT_ONLY_KEYS = new Set([
|
|
7765
|
+
const PROJECT_ONLY_KEYS = /* @__PURE__ */ new Set([
|
|
7766
7766
|
"displayName",
|
|
7767
7767
|
"exclude",
|
|
7768
7768
|
"include",
|
|
@@ -8141,7 +8141,7 @@ function isGeneratedStub(filePath) {
|
|
|
8141
8141
|
}
|
|
8142
8142
|
}
|
|
8143
8143
|
const LEGACY_LUA_FILENAME = "jest.config.lua";
|
|
8144
|
-
const SKIP_FIELDS = new Set(["exclude", "include"]);
|
|
8144
|
+
const SKIP_FIELDS = /* @__PURE__ */ new Set(["exclude", "include"]);
|
|
8145
8145
|
function serializeToLuau(config) {
|
|
8146
8146
|
let output = `${HEADER}return {\n`;
|
|
8147
8147
|
for (const [key, value] of Object.entries(config)) {
|
|
@@ -8165,7 +8165,7 @@ function generateProjectConfigs(projects) {
|
|
|
8165
8165
|
if (path.basename(project.outputPath) === "jest.config.luau") removeLegacyGeneratedStub(directory);
|
|
8166
8166
|
}
|
|
8167
8167
|
}
|
|
8168
|
-
const STUB_SKIP_KEYS = new Set([
|
|
8168
|
+
const STUB_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
8169
8169
|
"displayName",
|
|
8170
8170
|
"exclude",
|
|
8171
8171
|
"include",
|
|
@@ -8469,8 +8469,8 @@ function mergeResults(results) {
|
|
|
8469
8469
|
}
|
|
8470
8470
|
//#endregion
|
|
8471
8471
|
//#region src/typecheck/collect.ts
|
|
8472
|
-
const TEST_FUNCTIONS = new Set(["it", "test"]);
|
|
8473
|
-
const ALL_FUNCTIONS = new Set([
|
|
8472
|
+
const TEST_FUNCTIONS = /* @__PURE__ */ new Set(["it", "test"]);
|
|
8473
|
+
const ALL_FUNCTIONS = /* @__PURE__ */ new Set([.../* @__PURE__ */ new Set(["describe", "suite"]), ...TEST_FUNCTIONS]);
|
|
8474
8474
|
function collectTestDefinitions(source) {
|
|
8475
8475
|
const result = parseSync("test.ts", source);
|
|
8476
8476
|
const raw = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isentinel/jest-roblox",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "Jest-compatible CLI for running roblox-ts tests via Roblox Open Cloud",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jest",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"!dist/**/*.tsbuildinfo"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@bedrock-rbx/ocale": "0.1.0-beta.
|
|
51
|
+
"@bedrock-rbx/ocale": "0.1.0-beta.18",
|
|
52
52
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
53
53
|
"arktype": "2.2.0",
|
|
54
54
|
"c12": "4.0.0-beta.5",
|