@isentinel/jest-roblox 0.1.4 → 0.1.5
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as hashBuffer, C as resolveNestedProjects, D as createStudioBackend, F as VALID_BACKENDS, P as ROOT_ONLY_KEYS, R as isValidBackend, S as collectPaths, _ as formatResult, a as formatAnnotations, b as formatBanner, c as execute, d as findFormatterOptions, g as formatMultiProjectResult, i as runTypecheck, k as createOpenCloudBackend, l as formatExecuteOutput, m as formatAgentMultiProject, n as parseGameOutput, o as formatJobSummary, p as writeJsonFile, r as writeGameOutput, s as resolveGitHubActionsOptions, t as formatGameOutputNotice, u as loadCoverageManifest, w as loadConfig$1, x as rojoProjectSchema, y as formatTypecheckSummary, z as LuauScriptError } from "./game-output-
|
|
1
|
+
import { A as hashBuffer, C as resolveNestedProjects, D as createStudioBackend, F as VALID_BACKENDS, P as ROOT_ONLY_KEYS, R as isValidBackend, S as collectPaths, _ as formatResult, a as formatAnnotations, b as formatBanner, c as execute, d as findFormatterOptions, g as formatMultiProjectResult, i as runTypecheck, k as createOpenCloudBackend, l as formatExecuteOutput, m as formatAgentMultiProject, n as parseGameOutput, o as formatJobSummary, p as writeJsonFile, r as writeGameOutput, s as resolveGitHubActionsOptions, t as formatGameOutputNotice, u as loadCoverageManifest, w as loadConfig$1, x as rojoProjectSchema, y as formatTypecheckSummary, z as LuauScriptError } from "./game-output-71ciORUU.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { type } from "arktype";
|
|
4
4
|
import assert from "node:assert";
|
|
@@ -23,7 +23,7 @@ import istanbulCoverage from "istanbul-lib-coverage";
|
|
|
23
23
|
import istanbulReport from "istanbul-lib-report";
|
|
24
24
|
import istanbulReports from "istanbul-reports";
|
|
25
25
|
//#region package.json
|
|
26
|
-
var version = "0.1.
|
|
26
|
+
var version = "0.1.5";
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/backends/auto.ts
|
|
29
29
|
var StudioWithFallback = class {
|
|
@@ -1975,15 +1975,31 @@ function printCoverageHeader() {
|
|
|
1975
1975
|
const header = ` ${color.blue("%")} ${color.dim("Coverage report from")} ${color.yellow("istanbul")}`;
|
|
1976
1976
|
process.stdout.write(`\n${header}\n`);
|
|
1977
1977
|
}
|
|
1978
|
+
const TEXT_REPORTERS = new Set(["text", "text-summary"]);
|
|
1978
1979
|
function generateReports(options) {
|
|
1979
1980
|
const coverageMap = buildCoverageMap(filterMappedFiles(options.mapped, options.collectCoverageFrom));
|
|
1980
1981
|
const context = istanbulReport.createContext({
|
|
1981
1982
|
coverageMap,
|
|
1983
|
+
defaultSummarizer: options.agentMode === true ? "flat" : "pkg",
|
|
1982
1984
|
dir: options.coverageDirectory
|
|
1983
1985
|
});
|
|
1986
|
+
const terminalColumns = getTerminalColumns();
|
|
1987
|
+
const allFilesFull = options.agentMode === true && isAllFilesFull(coverageMap);
|
|
1984
1988
|
for (const reporterName of options.reporters) {
|
|
1985
1989
|
if (!isValidReporter(reporterName)) throw new Error(`Unknown coverage reporter: ${reporterName}`);
|
|
1986
|
-
|
|
1990
|
+
if (allFilesFull && TEXT_REPORTERS.has(reporterName)) {
|
|
1991
|
+
const fileCount = coverageMap.files().length;
|
|
1992
|
+
const label = fileCount === 1 ? "file" : "files";
|
|
1993
|
+
process.stdout.write(`Coverage: 100% (${fileCount} ${label})\n`);
|
|
1994
|
+
continue;
|
|
1995
|
+
}
|
|
1996
|
+
let reporterOptions = {};
|
|
1997
|
+
if (reporterName === "text") reporterOptions = {
|
|
1998
|
+
maxCols: terminalColumns,
|
|
1999
|
+
skipFull: options.agentMode === true
|
|
2000
|
+
};
|
|
2001
|
+
else if (TEXT_REPORTERS.has(reporterName)) reporterOptions = { skipFull: options.agentMode === true };
|
|
2002
|
+
istanbulReports.create(reporterName, reporterOptions).execute(context);
|
|
1987
2003
|
}
|
|
1988
2004
|
}
|
|
1989
2005
|
function checkThresholds(mapped, thresholds, collectCoverageFrom) {
|
|
@@ -2024,6 +2040,21 @@ function checkThresholds(mapped, thresholds, collectCoverageFrom) {
|
|
|
2024
2040
|
passed: failures.length === 0
|
|
2025
2041
|
};
|
|
2026
2042
|
}
|
|
2043
|
+
function getTerminalColumns() {
|
|
2044
|
+
if (process.stdout.columns !== void 0) return process.stdout.columns;
|
|
2045
|
+
const columnsEnvironment = process.env["COLUMNS"];
|
|
2046
|
+
if (columnsEnvironment === void 0) return;
|
|
2047
|
+
const parsed = Number(columnsEnvironment);
|
|
2048
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : void 0;
|
|
2049
|
+
}
|
|
2050
|
+
function isAllFilesFull(coverageMap) {
|
|
2051
|
+
const files = coverageMap.files();
|
|
2052
|
+
if (files.length === 0) return false;
|
|
2053
|
+
return files.every((file) => {
|
|
2054
|
+
const summary = coverageMap.fileCoverageFor(file).toSummary();
|
|
2055
|
+
return summary.statements.pct === 100 && summary.branches.pct === 100 && summary.functions.pct === 100 && summary.lines.pct === 100;
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2027
2058
|
function buildCoverageMap(mapped) {
|
|
2028
2059
|
const coverageMap = istanbulCoverage.createCoverageMap({});
|
|
2029
2060
|
for (const [filePath, fileCoverage] of Object.entries(mapped.files)) {
|
|
@@ -2386,6 +2417,12 @@ function printFinalStatus(passed) {
|
|
|
2386
2417
|
const badge = passed ? color.bgGreen(color.black(color.bold(" PASS "))) : color.bgRed(color.white(color.bold(" FAIL ")));
|
|
2387
2418
|
process.stdout.write(`${badge}\n`);
|
|
2388
2419
|
}
|
|
2420
|
+
function hasFormatter(config, name) {
|
|
2421
|
+
return config.formatters?.some((entry) => Array.isArray(entry) ? entry[0] === name : entry === name) === true;
|
|
2422
|
+
}
|
|
2423
|
+
function usesAgentFormatter(config) {
|
|
2424
|
+
return hasFormatter(config, "agent") && !config.verbose;
|
|
2425
|
+
}
|
|
2389
2426
|
function processCoverage(config, coverageData) {
|
|
2390
2427
|
if (!config.collectCoverage) return true;
|
|
2391
2428
|
if (coverageData === void 0) {
|
|
@@ -2401,6 +2438,7 @@ function processCoverage(config, coverageData) {
|
|
|
2401
2438
|
const coverageDirectory = path$1.resolve(config.rootDir, config.coverageDirectory);
|
|
2402
2439
|
if (!config.silent) printCoverageHeader();
|
|
2403
2440
|
generateReports({
|
|
2441
|
+
agentMode: usesAgentFormatter(config),
|
|
2404
2442
|
collectCoverageFrom: config.collectCoverageFrom,
|
|
2405
2443
|
coverageDirectory,
|
|
2406
2444
|
mapped,
|
|
@@ -2434,18 +2472,12 @@ function runGitHubActionsFormatter(config, result, sourceMapper) {
|
|
|
2434
2472
|
}
|
|
2435
2473
|
}
|
|
2436
2474
|
}
|
|
2437
|
-
function hasFormatter(config, name) {
|
|
2438
|
-
return config.formatters?.some((entry) => Array.isArray(entry) ? entry[0] === name : entry === name) === true;
|
|
2439
|
-
}
|
|
2440
2475
|
function getAgentMaxFailures(config) {
|
|
2441
2476
|
assert(config.formatters !== void 0, "formatters is set by resolveFormatters");
|
|
2442
2477
|
const options = findFormatterOptions(config.formatters, "agent");
|
|
2443
2478
|
if (options !== void 0 && typeof options["maxFailures"] === "number") return options["maxFailures"];
|
|
2444
2479
|
return 10;
|
|
2445
2480
|
}
|
|
2446
|
-
function usesAgentFormatter(config) {
|
|
2447
|
-
return hasFormatter(config, "agent") && !config.verbose;
|
|
2448
|
-
}
|
|
2449
2481
|
function usesDefaultFormatter(config) {
|
|
2450
2482
|
return !hasFormatter(config, "json") && !usesAgentFormatter(config);
|
|
2451
2483
|
}
|
|
@@ -2806,8 +2806,7 @@ function createFileLink(options) {
|
|
|
2806
2806
|
//#endregion
|
|
2807
2807
|
//#region src/typecheck/collect.ts
|
|
2808
2808
|
const TEST_FUNCTIONS = new Set(["it", "test"]);
|
|
2809
|
-
const
|
|
2810
|
-
const ALL_FUNCTIONS = new Set([...SUITE_FUNCTIONS, ...TEST_FUNCTIONS]);
|
|
2809
|
+
const ALL_FUNCTIONS = new Set([...new Set(["describe", "suite"]), ...TEST_FUNCTIONS]);
|
|
2811
2810
|
function collectTestDefinitions(source) {
|
|
2812
2811
|
const result = parseSync("test.ts", source);
|
|
2813
2812
|
const raw = [];
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as extractJsonFromOutput, D as createStudioBackend, E as StudioBackend, I as defineConfig, L as defineProject, M as generateTestScript, N as DEFAULT_CONFIG, O as OpenCloudBackend, P as ROOT_ONLY_KEYS, T as resolveConfig, V as parseJestOutput, _ as formatResult, a as formatAnnotations, c as execute, f as formatJson, h as formatFailure, i as runTypecheck, j as buildJestArgv, k as createOpenCloudBackend, l as formatExecuteOutput, n as parseGameOutput, o as formatJobSummary, p as writeJsonFile, r as writeGameOutput, t as formatGameOutputNotice, v as formatTestSummary, w as loadConfig } from "./game-output-
|
|
1
|
+
import { B as extractJsonFromOutput, D as createStudioBackend, E as StudioBackend, I as defineConfig, L as defineProject, M as generateTestScript, N as DEFAULT_CONFIG, O as OpenCloudBackend, P as ROOT_ONLY_KEYS, T as resolveConfig, V as parseJestOutput, _ as formatResult, a as formatAnnotations, c as execute, f as formatJson, h as formatFailure, i as runTypecheck, j as buildJestArgv, k as createOpenCloudBackend, l as formatExecuteOutput, n as parseGameOutput, o as formatJobSummary, p as writeJsonFile, r as writeGameOutput, t as formatGameOutputNotice, v as formatTestSummary, w as loadConfig } from "./game-output-71ciORUU.mjs";
|
|
2
2
|
export { DEFAULT_CONFIG, OpenCloudBackend, ROOT_ONLY_KEYS, StudioBackend, buildJestArgv, createOpenCloudBackend, createStudioBackend, defineConfig, defineProject, execute, extractJsonFromOutput, formatAnnotations, formatExecuteOutput, formatFailure, formatGameOutputNotice, formatJobSummary, formatJson, formatResult, formatTestSummary, generateTestScript, loadConfig, parseGameOutput, parseJestOutput, resolveConfig, runTypecheck, writeGameOutput, writeJsonFile };
|
package/dist/sea/jest-roblox
CHANGED
|
Binary file
|
package/dist/sea-entry.cjs
CHANGED
|
@@ -804,7 +804,6 @@ var Scanner = class {
|
|
|
804
804
|
const writeUnmatchedGroupCloseMessage = (char, unscanned) => `Unmatched ${char}${unscanned === "" ? "" : ` before ${unscanned}`}`;
|
|
805
805
|
const writeUnclosedGroupMessage = (missingChar) => `Missing ${missingChar}`;
|
|
806
806
|
noSuggest("implementedTraits");
|
|
807
|
-
Symbol.hasInstance;
|
|
808
807
|
//#endregion
|
|
809
808
|
//#region node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/registry.js
|
|
810
809
|
let _registryName = "$ark";
|
|
@@ -7640,7 +7639,7 @@ function f$9() {
|
|
|
7640
7639
|
var C$5 = f$9();
|
|
7641
7640
|
//#endregion
|
|
7642
7641
|
//#region package.json
|
|
7643
|
-
var version = "0.1.
|
|
7642
|
+
var version = "0.1.5";
|
|
7644
7643
|
//#endregion
|
|
7645
7644
|
//#region node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/stream.js
|
|
7646
7645
|
var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -50631,7 +50630,7 @@ const p = (r) => Object.keys(r).reduce((t, e) => {
|
|
|
50631
50630
|
return n;
|
|
50632
50631
|
};
|
|
50633
50632
|
//#endregion
|
|
50634
|
-
//#region node_modules/.pnpm/get-tsconfig@4.13.
|
|
50633
|
+
//#region node_modules/.pnpm/get-tsconfig@4.13.7/node_modules/get-tsconfig/dist/index.mjs
|
|
50635
50634
|
var Le = Object.defineProperty;
|
|
50636
50635
|
var i = (e, t) => Le(e, "name", {
|
|
50637
50636
|
value: t,
|
|
@@ -51219,7 +51218,7 @@ const me = i((e, t) => Re($e(t, e, "utf8")), "readJsonc"), C = Symbol("implicitB
|
|
|
51219
51218
|
r && (Array.isArray(n.exclude) || (n.exclude = be.map((g) => l[g]).filter(Boolean)), r.startsWith(I) || (r = K(r)), l[a] = r);
|
|
51220
51219
|
}
|
|
51221
51220
|
} else n.compilerOptions = {};
|
|
51222
|
-
if (n.include
|
|
51221
|
+
if (n.include && (n.include = n.include.map(h)), n.files && (n.files = n.files.map((l) => l.startsWith(I) ? l : K(l))), n.watchOptions) {
|
|
51223
51222
|
const { watchOptions: l } = n;
|
|
51224
51223
|
l.excludeDirectories && (l.excludeDirectories = l.excludeDirectories.map((u) => h(node_path.default.resolve(o, u)))), l.excludeFiles && (l.excludeFiles = l.excludeFiles.map((u) => h(node_path.default.resolve(o, u)))), l.watchFile && (l.watchFile = l.watchFile.toLowerCase()), l.watchDirectory && (l.watchDirectory = l.watchDirectory.toLowerCase()), l.fallbackPolling && (l.fallbackPolling = l.fallbackPolling.toLowerCase());
|
|
51225
51224
|
}
|
|
@@ -51424,10 +51423,11 @@ i(({ config: e, path: t }, s = Oe()) => {
|
|
|
51424
51423
|
};
|
|
51425
51424
|
}, "createFilesMatcher");
|
|
51426
51425
|
//#endregion
|
|
51427
|
-
//#region node_modules/.pnpm/picomatch@4.0.
|
|
51426
|
+
//#region node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
|
|
51428
51427
|
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
51429
51428
|
const WIN_SLASH = "\\\\/";
|
|
51430
51429
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
51430
|
+
const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
51431
51431
|
/**
|
|
51432
51432
|
* Posix glob regex
|
|
51433
51433
|
*/
|
|
@@ -51477,8 +51477,10 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
51477
51477
|
SEP: "\\"
|
|
51478
51478
|
};
|
|
51479
51479
|
module.exports = {
|
|
51480
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
51480
51481
|
MAX_LENGTH: 1024 * 64,
|
|
51481
51482
|
POSIX_REGEX_SOURCE: {
|
|
51483
|
+
__proto__: null,
|
|
51482
51484
|
alnum: "a-zA-Z0-9",
|
|
51483
51485
|
alpha: "a-zA-Z",
|
|
51484
51486
|
ascii: "\\x00-\\x7F",
|
|
@@ -51584,7 +51586,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
51584
51586
|
};
|
|
51585
51587
|
}));
|
|
51586
51588
|
//#endregion
|
|
51587
|
-
//#region node_modules/.pnpm/picomatch@4.0.
|
|
51589
|
+
//#region node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js
|
|
51588
51590
|
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
51589
51591
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
|
|
51590
51592
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
@@ -51632,7 +51634,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
51632
51634
|
};
|
|
51633
51635
|
}));
|
|
51634
51636
|
//#endregion
|
|
51635
|
-
//#region node_modules/.pnpm/picomatch@4.0.
|
|
51637
|
+
//#region node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js
|
|
51636
51638
|
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
51637
51639
|
const utils = require_utils();
|
|
51638
51640
|
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants$1();
|
|
@@ -51919,7 +51921,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
51919
51921
|
module.exports = scan;
|
|
51920
51922
|
}));
|
|
51921
51923
|
//#endregion
|
|
51922
|
-
//#region node_modules/.pnpm/picomatch@4.0.
|
|
51924
|
+
//#region node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js
|
|
51923
51925
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
51924
51926
|
const constants = require_constants$1();
|
|
51925
51927
|
const utils = require_utils();
|
|
@@ -51947,6 +51949,177 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
51947
51949
|
const syntaxError = (type, char) => {
|
|
51948
51950
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
51949
51951
|
};
|
|
51952
|
+
const splitTopLevel = (input) => {
|
|
51953
|
+
const parts = [];
|
|
51954
|
+
let bracket = 0;
|
|
51955
|
+
let paren = 0;
|
|
51956
|
+
let quote = 0;
|
|
51957
|
+
let value = "";
|
|
51958
|
+
let escaped = false;
|
|
51959
|
+
for (const ch of input) {
|
|
51960
|
+
if (escaped === true) {
|
|
51961
|
+
value += ch;
|
|
51962
|
+
escaped = false;
|
|
51963
|
+
continue;
|
|
51964
|
+
}
|
|
51965
|
+
if (ch === "\\") {
|
|
51966
|
+
value += ch;
|
|
51967
|
+
escaped = true;
|
|
51968
|
+
continue;
|
|
51969
|
+
}
|
|
51970
|
+
if (ch === "\"") {
|
|
51971
|
+
quote = quote === 1 ? 0 : 1;
|
|
51972
|
+
value += ch;
|
|
51973
|
+
continue;
|
|
51974
|
+
}
|
|
51975
|
+
if (quote === 0) {
|
|
51976
|
+
if (ch === "[") bracket++;
|
|
51977
|
+
else if (ch === "]" && bracket > 0) bracket--;
|
|
51978
|
+
else if (bracket === 0) {
|
|
51979
|
+
if (ch === "(") paren++;
|
|
51980
|
+
else if (ch === ")" && paren > 0) paren--;
|
|
51981
|
+
else if (ch === "|" && paren === 0) {
|
|
51982
|
+
parts.push(value);
|
|
51983
|
+
value = "";
|
|
51984
|
+
continue;
|
|
51985
|
+
}
|
|
51986
|
+
}
|
|
51987
|
+
}
|
|
51988
|
+
value += ch;
|
|
51989
|
+
}
|
|
51990
|
+
parts.push(value);
|
|
51991
|
+
return parts;
|
|
51992
|
+
};
|
|
51993
|
+
const isPlainBranch = (branch) => {
|
|
51994
|
+
let escaped = false;
|
|
51995
|
+
for (const ch of branch) {
|
|
51996
|
+
if (escaped === true) {
|
|
51997
|
+
escaped = false;
|
|
51998
|
+
continue;
|
|
51999
|
+
}
|
|
52000
|
+
if (ch === "\\") {
|
|
52001
|
+
escaped = true;
|
|
52002
|
+
continue;
|
|
52003
|
+
}
|
|
52004
|
+
if (/[?*+@!()[\]{}]/.test(ch)) return false;
|
|
52005
|
+
}
|
|
52006
|
+
return true;
|
|
52007
|
+
};
|
|
52008
|
+
const normalizeSimpleBranch = (branch) => {
|
|
52009
|
+
let value = branch.trim();
|
|
52010
|
+
let changed = true;
|
|
52011
|
+
while (changed === true) {
|
|
52012
|
+
changed = false;
|
|
52013
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
52014
|
+
value = value.slice(2, -1);
|
|
52015
|
+
changed = true;
|
|
52016
|
+
}
|
|
52017
|
+
}
|
|
52018
|
+
if (!isPlainBranch(value)) return;
|
|
52019
|
+
return value.replace(/\\(.)/g, "$1");
|
|
52020
|
+
};
|
|
52021
|
+
const hasRepeatedCharPrefixOverlap = (branches) => {
|
|
52022
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
52023
|
+
for (let i = 0; i < values.length; i++) for (let j = i + 1; j < values.length; j++) {
|
|
52024
|
+
const a = values[i];
|
|
52025
|
+
const b = values[j];
|
|
52026
|
+
const char = a[0];
|
|
52027
|
+
if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) continue;
|
|
52028
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
|
|
52029
|
+
}
|
|
52030
|
+
return false;
|
|
52031
|
+
};
|
|
52032
|
+
const parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
52033
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") return;
|
|
52034
|
+
let bracket = 0;
|
|
52035
|
+
let paren = 0;
|
|
52036
|
+
let quote = 0;
|
|
52037
|
+
let escaped = false;
|
|
52038
|
+
for (let i = 1; i < pattern.length; i++) {
|
|
52039
|
+
const ch = pattern[i];
|
|
52040
|
+
if (escaped === true) {
|
|
52041
|
+
escaped = false;
|
|
52042
|
+
continue;
|
|
52043
|
+
}
|
|
52044
|
+
if (ch === "\\") {
|
|
52045
|
+
escaped = true;
|
|
52046
|
+
continue;
|
|
52047
|
+
}
|
|
52048
|
+
if (ch === "\"") {
|
|
52049
|
+
quote = quote === 1 ? 0 : 1;
|
|
52050
|
+
continue;
|
|
52051
|
+
}
|
|
52052
|
+
if (quote === 1) continue;
|
|
52053
|
+
if (ch === "[") {
|
|
52054
|
+
bracket++;
|
|
52055
|
+
continue;
|
|
52056
|
+
}
|
|
52057
|
+
if (ch === "]" && bracket > 0) {
|
|
52058
|
+
bracket--;
|
|
52059
|
+
continue;
|
|
52060
|
+
}
|
|
52061
|
+
if (bracket > 0) continue;
|
|
52062
|
+
if (ch === "(") {
|
|
52063
|
+
paren++;
|
|
52064
|
+
continue;
|
|
52065
|
+
}
|
|
52066
|
+
if (ch === ")") {
|
|
52067
|
+
paren--;
|
|
52068
|
+
if (paren === 0) {
|
|
52069
|
+
if (requireEnd === true && i !== pattern.length - 1) return;
|
|
52070
|
+
return {
|
|
52071
|
+
type: pattern[0],
|
|
52072
|
+
body: pattern.slice(2, i),
|
|
52073
|
+
end: i
|
|
52074
|
+
};
|
|
52075
|
+
}
|
|
52076
|
+
}
|
|
52077
|
+
}
|
|
52078
|
+
};
|
|
52079
|
+
const getStarExtglobSequenceOutput = (pattern) => {
|
|
52080
|
+
let index = 0;
|
|
52081
|
+
const chars = [];
|
|
52082
|
+
while (index < pattern.length) {
|
|
52083
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
52084
|
+
if (!match || match.type !== "*") return;
|
|
52085
|
+
const branches = splitTopLevel(match.body).map((branch) => branch.trim());
|
|
52086
|
+
if (branches.length !== 1) return;
|
|
52087
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
52088
|
+
if (!branch || branch.length !== 1) return;
|
|
52089
|
+
chars.push(branch);
|
|
52090
|
+
index += match.end + 1;
|
|
52091
|
+
}
|
|
52092
|
+
if (chars.length < 1) return;
|
|
52093
|
+
return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
|
|
52094
|
+
};
|
|
52095
|
+
const repeatedExtglobRecursion = (pattern) => {
|
|
52096
|
+
let depth = 0;
|
|
52097
|
+
let value = pattern.trim();
|
|
52098
|
+
let match = parseRepeatedExtglob(value);
|
|
52099
|
+
while (match) {
|
|
52100
|
+
depth++;
|
|
52101
|
+
value = match.body.trim();
|
|
52102
|
+
match = parseRepeatedExtglob(value);
|
|
52103
|
+
}
|
|
52104
|
+
return depth;
|
|
52105
|
+
};
|
|
52106
|
+
const analyzeRepeatedExtglob = (body, options) => {
|
|
52107
|
+
if (options.maxExtglobRecursion === false) return { risky: false };
|
|
52108
|
+
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
52109
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
52110
|
+
if (branches.length > 1) {
|
|
52111
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
|
|
52112
|
+
}
|
|
52113
|
+
for (const branch of branches) {
|
|
52114
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
52115
|
+
if (safeOutput) return {
|
|
52116
|
+
risky: true,
|
|
52117
|
+
safeOutput
|
|
52118
|
+
};
|
|
52119
|
+
if (repeatedExtglobRecursion(branch) > max) return { risky: true };
|
|
52120
|
+
}
|
|
52121
|
+
return { risky: false };
|
|
52122
|
+
};
|
|
51950
52123
|
/**
|
|
51951
52124
|
* Parse the given input string.
|
|
51952
52125
|
* @param {String} input
|
|
@@ -52076,6 +52249,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
52076
52249
|
token.prev = prev;
|
|
52077
52250
|
token.parens = state.parens;
|
|
52078
52251
|
token.output = state.output;
|
|
52252
|
+
token.startIndex = state.index;
|
|
52253
|
+
token.tokensIndex = tokens.length;
|
|
52079
52254
|
const output = (opts.capture ? "(" : "") + token.open;
|
|
52080
52255
|
increment("parens");
|
|
52081
52256
|
push({
|
|
@@ -52092,6 +52267,30 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
52092
52267
|
extglobs.push(token);
|
|
52093
52268
|
};
|
|
52094
52269
|
const extglobClose = (token) => {
|
|
52270
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
52271
|
+
const analysis = analyzeRepeatedExtglob(input.slice(token.startIndex + 2, state.index), opts);
|
|
52272
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
52273
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
52274
|
+
const open = tokens[token.tokensIndex];
|
|
52275
|
+
open.type = "text";
|
|
52276
|
+
open.value = literal;
|
|
52277
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
52278
|
+
for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
|
|
52279
|
+
tokens[i].value = "";
|
|
52280
|
+
tokens[i].output = "";
|
|
52281
|
+
delete tokens[i].suffix;
|
|
52282
|
+
}
|
|
52283
|
+
state.output = token.output + open.output;
|
|
52284
|
+
state.backtrack = true;
|
|
52285
|
+
push({
|
|
52286
|
+
type: "paren",
|
|
52287
|
+
extglob: true,
|
|
52288
|
+
value,
|
|
52289
|
+
output: ""
|
|
52290
|
+
});
|
|
52291
|
+
decrement("parens");
|
|
52292
|
+
return;
|
|
52293
|
+
}
|
|
52095
52294
|
let output = token.close + (opts.capture ? ")" : "");
|
|
52096
52295
|
let rest;
|
|
52097
52296
|
if (token.type === "negate") {
|
|
@@ -52777,7 +52976,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
52777
52976
|
module.exports = parse;
|
|
52778
52977
|
}));
|
|
52779
52978
|
//#endregion
|
|
52780
|
-
//#region node_modules/.pnpm/picomatch@4.0.
|
|
52979
|
+
//#region node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js
|
|
52781
52980
|
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
52782
52981
|
const scan = require_scan();
|
|
52783
52982
|
const parse = require_parse();
|
|
@@ -52987,6 +53186,14 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
52987
53186
|
* Compile a regular expression from the `state` object returned by the
|
|
52988
53187
|
* [parse()](#parse) method.
|
|
52989
53188
|
*
|
|
53189
|
+
* ```js
|
|
53190
|
+
* const picomatch = require('picomatch');
|
|
53191
|
+
* const state = picomatch.parse('*.js');
|
|
53192
|
+
* // picomatch.compileRe(state[, options]);
|
|
53193
|
+
*
|
|
53194
|
+
* console.log(picomatch.compileRe(state));
|
|
53195
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
53196
|
+
* ```
|
|
52990
53197
|
* @param {Object} `state`
|
|
52991
53198
|
* @param {Object} `options`
|
|
52992
53199
|
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
|
|
@@ -53010,10 +53217,10 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
53010
53217
|
*
|
|
53011
53218
|
* ```js
|
|
53012
53219
|
* const picomatch = require('picomatch');
|
|
53013
|
-
*
|
|
53014
|
-
* // picomatch.compileRe(state[, options]);
|
|
53220
|
+
* // picomatch.makeRe(state[, options]);
|
|
53015
53221
|
*
|
|
53016
|
-
*
|
|
53222
|
+
* const result = picomatch.makeRe('*.js');
|
|
53223
|
+
* console.log(result);
|
|
53017
53224
|
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
53018
53225
|
* ```
|
|
53019
53226
|
* @param {String} `state` The object returned from the `.parse` method.
|
|
@@ -55934,15 +56141,31 @@ function printCoverageHeader() {
|
|
|
55934
56141
|
const header = ` ${C$5.blue("%")} ${C$5.dim("Coverage report from")} ${C$5.yellow("istanbul")}`;
|
|
55935
56142
|
node_process.default.stdout.write(`\n${header}\n`);
|
|
55936
56143
|
}
|
|
56144
|
+
const TEXT_REPORTERS = new Set(["text", "text-summary"]);
|
|
55937
56145
|
function generateReports(options) {
|
|
55938
56146
|
const coverageMap = buildCoverageMap(filterMappedFiles(options.mapped, options.collectCoverageFrom));
|
|
55939
56147
|
const context = import_istanbul_lib_report.default.createContext({
|
|
55940
56148
|
coverageMap,
|
|
56149
|
+
defaultSummarizer: options.agentMode === true ? "flat" : "pkg",
|
|
55941
56150
|
dir: options.coverageDirectory
|
|
55942
56151
|
});
|
|
56152
|
+
const terminalColumns = getTerminalColumns();
|
|
56153
|
+
const allFilesFull = options.agentMode === true && isAllFilesFull(coverageMap);
|
|
55943
56154
|
for (const reporterName of options.reporters) {
|
|
55944
56155
|
if (!isValidReporter(reporterName)) throw new Error(`Unknown coverage reporter: ${reporterName}`);
|
|
55945
|
-
|
|
56156
|
+
if (allFilesFull && TEXT_REPORTERS.has(reporterName)) {
|
|
56157
|
+
const fileCount = coverageMap.files().length;
|
|
56158
|
+
const label = fileCount === 1 ? "file" : "files";
|
|
56159
|
+
node_process.default.stdout.write(`Coverage: 100% (${fileCount} ${label})\n`);
|
|
56160
|
+
continue;
|
|
56161
|
+
}
|
|
56162
|
+
let reporterOptions = {};
|
|
56163
|
+
if (reporterName === "text") reporterOptions = {
|
|
56164
|
+
maxCols: terminalColumns,
|
|
56165
|
+
skipFull: options.agentMode === true
|
|
56166
|
+
};
|
|
56167
|
+
else if (TEXT_REPORTERS.has(reporterName)) reporterOptions = { skipFull: options.agentMode === true };
|
|
56168
|
+
import_istanbul_reports.default.create(reporterName, reporterOptions).execute(context);
|
|
55946
56169
|
}
|
|
55947
56170
|
}
|
|
55948
56171
|
function checkThresholds(mapped, thresholds, collectCoverageFrom) {
|
|
@@ -55983,6 +56206,21 @@ function checkThresholds(mapped, thresholds, collectCoverageFrom) {
|
|
|
55983
56206
|
passed: failures.length === 0
|
|
55984
56207
|
};
|
|
55985
56208
|
}
|
|
56209
|
+
function getTerminalColumns() {
|
|
56210
|
+
if (node_process.default.stdout.columns !== void 0) return node_process.default.stdout.columns;
|
|
56211
|
+
const columnsEnvironment = node_process.default.env["COLUMNS"];
|
|
56212
|
+
if (columnsEnvironment === void 0) return;
|
|
56213
|
+
const parsed = Number(columnsEnvironment);
|
|
56214
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : void 0;
|
|
56215
|
+
}
|
|
56216
|
+
function isAllFilesFull(coverageMap) {
|
|
56217
|
+
const files = coverageMap.files();
|
|
56218
|
+
if (files.length === 0) return false;
|
|
56219
|
+
return files.every((file) => {
|
|
56220
|
+
const summary = coverageMap.fileCoverageFor(file).toSummary();
|
|
56221
|
+
return summary.statements.pct === 100 && summary.branches.pct === 100 && summary.functions.pct === 100 && summary.lines.pct === 100;
|
|
56222
|
+
});
|
|
56223
|
+
}
|
|
55986
56224
|
function buildCoverageMap(mapped) {
|
|
55987
56225
|
const coverageMap = import_istanbul_lib_coverage.default.createCoverageMap({});
|
|
55988
56226
|
for (const [filePath, fileCoverage] of Object.entries(mapped.files)) {
|
|
@@ -58160,7 +58398,7 @@ var core_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exp
|
|
|
58160
58398
|
module.exports = highlight;
|
|
58161
58399
|
highlight.HighlightJS = highlight;
|
|
58162
58400
|
highlight.default = highlight;
|
|
58163
|
-
})))()
|
|
58401
|
+
})))())).default;
|
|
58164
58402
|
//#endregion
|
|
58165
58403
|
//#region node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js
|
|
58166
58404
|
const IDENT_RE = "[A-Za-z$_][0-9A-Za-z$_]*";
|
|
@@ -60461,8 +60699,7 @@ var import__sea_stub_oxc_parser = (/* @__PURE__ */ __commonJSMin(((exports, modu
|
|
|
60461
60699
|
module.exports = {};
|
|
60462
60700
|
})))();
|
|
60463
60701
|
const TEST_FUNCTIONS = new Set(["it", "test"]);
|
|
60464
|
-
const
|
|
60465
|
-
const ALL_FUNCTIONS = new Set([...SUITE_FUNCTIONS, ...TEST_FUNCTIONS]);
|
|
60702
|
+
const ALL_FUNCTIONS = new Set([...new Set(["describe", "suite"]), ...TEST_FUNCTIONS]);
|
|
60466
60703
|
function collectTestDefinitions(source) {
|
|
60467
60704
|
const result = (0, import__sea_stub_oxc_parser.parseSync)("test.ts", source);
|
|
60468
60705
|
const raw = [];
|
|
@@ -61046,6 +61283,12 @@ function printFinalStatus(passed) {
|
|
|
61046
61283
|
const badge = passed ? C$5.bgGreen(C$5.black(C$5.bold(" PASS "))) : C$5.bgRed(C$5.white(C$5.bold(" FAIL ")));
|
|
61047
61284
|
node_process.default.stdout.write(`${badge}\n`);
|
|
61048
61285
|
}
|
|
61286
|
+
function hasFormatter(config, name) {
|
|
61287
|
+
return config.formatters?.some((entry) => Array.isArray(entry) ? entry[0] === name : entry === name) === true;
|
|
61288
|
+
}
|
|
61289
|
+
function usesAgentFormatter(config) {
|
|
61290
|
+
return hasFormatter(config, "agent") && !config.verbose;
|
|
61291
|
+
}
|
|
61049
61292
|
function processCoverage(config, coverageData) {
|
|
61050
61293
|
if (!config.collectCoverage) return true;
|
|
61051
61294
|
if (coverageData === void 0) {
|
|
@@ -61061,6 +61304,7 @@ function processCoverage(config, coverageData) {
|
|
|
61061
61304
|
const coverageDirectory = node_path.resolve(config.rootDir, config.coverageDirectory);
|
|
61062
61305
|
if (!config.silent) printCoverageHeader();
|
|
61063
61306
|
generateReports({
|
|
61307
|
+
agentMode: usesAgentFormatter(config),
|
|
61064
61308
|
collectCoverageFrom: config.collectCoverageFrom,
|
|
61065
61309
|
coverageDirectory,
|
|
61066
61310
|
mapped,
|
|
@@ -61094,18 +61338,12 @@ function runGitHubActionsFormatter(config, result, sourceMapper) {
|
|
|
61094
61338
|
}
|
|
61095
61339
|
}
|
|
61096
61340
|
}
|
|
61097
|
-
function hasFormatter(config, name) {
|
|
61098
|
-
return config.formatters?.some((entry) => Array.isArray(entry) ? entry[0] === name : entry === name) === true;
|
|
61099
|
-
}
|
|
61100
61341
|
function getAgentMaxFailures(config) {
|
|
61101
61342
|
(0, node_assert.default)(config.formatters !== void 0, "formatters is set by resolveFormatters");
|
|
61102
61343
|
const options = findFormatterOptions(config.formatters, "agent");
|
|
61103
61344
|
if (options !== void 0 && typeof options["maxFailures"] === "number") return options["maxFailures"];
|
|
61104
61345
|
return 10;
|
|
61105
61346
|
}
|
|
61106
|
-
function usesAgentFormatter(config) {
|
|
61107
|
-
return hasFormatter(config, "agent") && !config.verbose;
|
|
61108
|
-
}
|
|
61109
61347
|
function usesDefaultFormatter(config) {
|
|
61110
61348
|
return !hasFormatter(config, "json") && !usesAgentFormatter(config);
|
|
61111
61349
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isentinel/jest-roblox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Jest-compatible CLI for running roblox-ts tests via Roblox Open Cloud",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jest",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"c12": "4.0.0-beta.4",
|
|
45
45
|
"confbox": "0.2.4",
|
|
46
46
|
"defu": "6.1.4",
|
|
47
|
-
"get-tsconfig": "4.13.
|
|
47
|
+
"get-tsconfig": "4.13.7",
|
|
48
48
|
"highlight.js": "11.11.1",
|
|
49
49
|
"istanbul-lib-coverage": "3.2.2",
|
|
50
50
|
"istanbul-lib-report": "3.0.1",
|
|
51
51
|
"istanbul-reports": "3.2.0",
|
|
52
52
|
"oxc-parser": "0.120.0",
|
|
53
|
-
"picomatch": "4.0.
|
|
53
|
+
"picomatch": "4.0.4",
|
|
54
54
|
"std-env": "4.0.0",
|
|
55
55
|
"tinyrainbow": "3.0.3",
|
|
56
56
|
"ws": "8.18.0"
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
"@isentinel/tsconfig": "1.2.0",
|
|
61
61
|
"@oxc-project/types": "0.120.0",
|
|
62
62
|
"@rbxts/jest": "3.13.3-ts.1",
|
|
63
|
-
"@rbxts/types": "1.0.
|
|
63
|
+
"@rbxts/types": "1.0.913",
|
|
64
64
|
"@total-typescript/shoehorn": "0.1.2",
|
|
65
|
-
"@tsdown/exe": "0.21.
|
|
65
|
+
"@tsdown/exe": "0.21.5",
|
|
66
66
|
"@types/istanbul-lib-coverage": "2.0.6",
|
|
67
67
|
"@types/istanbul-lib-report": "3.0.3",
|
|
68
68
|
"@types/istanbul-reports": "3.0.4",
|
|
69
69
|
"@types/node": "24.10.13",
|
|
70
70
|
"@types/picomatch": "4.0.2",
|
|
71
71
|
"@types/ws": "8.5.13",
|
|
72
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
72
|
+
"@typescript/native-preview": "7.0.0-dev.20260325.1",
|
|
73
73
|
"@vitest/coverage-v8": "4.1.0",
|
|
74
74
|
"@vitest/eslint-plugin": "1.6.13",
|
|
75
75
|
"better-typescript-lib": "2.12.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"jest-extended": "7.0.0",
|
|
82
82
|
"memfs": "4.56.11",
|
|
83
83
|
"publint": "0.3.18",
|
|
84
|
-
"tsdown": "0.21.
|
|
84
|
+
"tsdown": "0.21.5",
|
|
85
85
|
"type-fest": "5.2.0",
|
|
86
86
|
"typescript": "5.9.3",
|
|
87
87
|
"vitest": "4.1.0"
|