@isentinel/jest-roblox 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -326,7 +326,7 @@ Create a file named drillbit.toml in your project's directory.
326
326
 
327
327
  ```toml
328
328
  [plugins.jest_roblox]
329
- github = "https://github.com/christopher-buss/jest-roblox-cli/releases/download/v0.3.0/JestRobloxRunner.rbxm"
329
+ github = "https://github.com/christopher-buss/jest-roblox-cli/releases/download/v0.2.7/JestRobloxRunner.rbxm"
330
330
  ```
331
331
 
332
332
  Then run `drillbit` and it will download the plugin and install it in Studio for you.
@@ -444,6 +444,7 @@ root, and `workspace.outputFile: true` writes a per-package result file per
444
444
  | `--outputFile <path>` | Write results to a file |
445
445
  | `--gameOutput <path>` | Write game print/warn/error to a file |
446
446
  | `--coverage` | Collect coverage |
447
+ | `--no-coverage` | Disable coverage for this run, even when enabled in config |
447
448
  | `--coverageDirectory <path>` | Where to put coverage reports |
448
449
  | `--coverageReporters <r...>` | Which report formats to use |
449
450
  | `--collectCoverageFrom <glob>` | Globs for files to include in coverage (repeatable) |
package/dist/cli.mjs CHANGED
@@ -1,31 +1,8 @@
1
- import { A as mergeCliWithConfig, D as LuauScriptError, E as formatBanner, H as ConfigError, R as VALID_BACKENDS, U as version, V as isValidBackend, f as outputMultiResult, j as loadConfig, p as outputSingleResult, t as runJestRoblox, y as parseGameOutput } from "./run-BEUPi80L.mjs";
1
+ import { B as VALID_BACKENDS, G as version, M as mergeCliWithConfig, N as loadConfig, O as formatBanner, U as isValidBackend, W as ConfigError, d as walkErrorChain, h as outputSingleResult, k as LuauScriptError, m as outputMultiResult, t as runJestRoblox, u as formatMissingScopes, x as parseGameOutput } from "./run-CyHhajiY.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";
5
5
  import color from "tinyrainbow";
6
- //#region src/utils/error-chain.ts
7
- const MAX_DEPTH = 5;
8
- function walkErrorChain(err) {
9
- const entries = [];
10
- let current = err;
11
- while (current instanceof Error && entries.length < MAX_DEPTH) {
12
- entries.push({
13
- name: current.constructor.name,
14
- code: readStringProperty(current, "code"),
15
- errno: readStringProperty(current, "errno"),
16
- message: current.message,
17
- syscall: readStringProperty(current, "syscall")
18
- });
19
- current = current.cause;
20
- }
21
- return entries;
22
- }
23
- function readStringProperty(err, key) {
24
- const value = Reflect.get(err, key);
25
- if (value === void 0 || value === null) return;
26
- return String(value);
27
- }
28
- //#endregion
29
6
  //#region src/cli.ts
30
7
  const VERSION = version;
31
8
  const HELP_TEXT = `
@@ -47,6 +24,7 @@ Options:
47
24
  --no-color Disable colored output
48
25
  -u, --updateSnapshot Update snapshot files
49
26
  --coverage Enable coverage collection
27
+ --no-coverage Disable coverage for this run (overrides config)
50
28
  --collectCoverageFrom <glob> Globs for files to include in coverage (repeatable)
51
29
  --coverageDirectory <path> Directory for coverage output (default: coverage)
52
30
  --coverageReporters <r...> Coverage reporters (default: text, lcov)
@@ -90,6 +68,7 @@ Examples:
90
68
  jest-roblox -t "should spawn" Run tests matching pattern
91
69
  jest-roblox --formatters json Output JSON to file
92
70
  jest-roblox --coverage Run tests with coverage instrumentation
71
+ jest-roblox --no-coverage Skip coverage instrumentation for this run
93
72
  `;
94
73
  function parseArgs(args) {
95
74
  const { positionals, values } = parseArgs$1({
@@ -122,6 +101,7 @@ function parseArgs(args) {
122
101
  type: "boolean"
123
102
  },
124
103
  "no-color": { type: "boolean" },
104
+ "no-coverage": { type: "boolean" },
125
105
  "no-coverage-cache": { type: "boolean" },
126
106
  "no-show-luau": { type: "boolean" },
127
107
  "outputFile": { type: "string" },
@@ -176,7 +156,7 @@ function parseArgs(args) {
176
156
  affectedSince: values["affected-since"],
177
157
  apiKey: values.apiKey,
178
158
  backend: validateBackend(values.backend),
179
- collectCoverage: values.coverage,
159
+ collectCoverage: values["no-coverage"] === true ? false : values.coverage,
180
160
  collectCoverageFrom: values.collectCoverageFrom,
181
161
  color: values["no-color"] === true ? false : values.color,
182
162
  config: values.config,
@@ -288,6 +268,7 @@ function formatBackendErrorBanner(err) {
288
268
  const extras = formatChainExtras(entry);
289
269
  const label = color.dim(`[${index.toString()}]`);
290
270
  body.push(` ${label} ${entry.name}: ${entry.message}${extras}`);
271
+ if (entry.requiredScopes !== void 0) body.push(` ${color.yellow(formatMissingScopes(entry.requiredScopes))}`);
291
272
  }
292
273
  return formatBanner({
293
274
  body,
package/dist/index.d.mts CHANGED
@@ -342,6 +342,28 @@ interface SourceMapper {
342
342
  resolveTestFilePath(testFilePath: string): string | undefined;
343
343
  }
344
344
  //#endregion
345
+ //#region src/timing/orchestration-collector.d.ts
346
+ interface TimingCollector {
347
+ flushTimingReport: () => void;
348
+ profile: <T>(name: string, func: () => T extends Promise<unknown> ? never : T) => T;
349
+ profileAsync: <T>(name: string, func: () => Promise<T>) => Promise<T>;
350
+ /**
351
+ * Register a leaf span under the current stack frame whose `elapsedMs` is
352
+ * supplied directly. Used to surface durations the orchestrator did not
353
+ * measure itself — the backend reports `uploadMs` / `executionMs` from
354
+ * inside its own `runTests` call, and the Luau runner reports per-game
355
+ * phases inside the Roblox VM. Repeated calls with the same `name`
356
+ * accumulate, matching `profile`'s behavior.
357
+ *
358
+ * Stack-empty fallback: when called outside any `profile`/`profileAsync`
359
+ * frame the span lands at root and contributes to `TOTAL (host)` like
360
+ * any other root. Call inside the relevant frame to keep totals clean
361
+ * — recording a value at root that is ALSO captured by a sibling root
362
+ * `profile` span would double-count toward the host total.
363
+ */
364
+ record: (name: string, elapsedMs: number) => void;
365
+ }
366
+ //#endregion
345
367
  //#region src/types/timing.d.ts
346
368
  interface TimingResult {
347
369
  coverageMs?: number;
@@ -389,6 +411,14 @@ interface RunProjectsOptions {
389
411
  scriptOverride?: string;
390
412
  startTime: number;
391
413
  streaming?: StreamingHooks;
414
+ /**
415
+ * Span-tree profiler owned by the top-level run. Optional so existing
416
+ * test seams (which exercise the executor directly) keep working without
417
+ * threading a collector through; production callers pass one through so
418
+ * the host waterfall captures `backend.runTests` + per-project
419
+ * post-processing.
420
+ */
421
+ timing?: TimingCollector;
392
422
  version: string;
393
423
  workStealing?: boolean;
394
424
  }
@@ -674,6 +704,12 @@ type RunResult = MultiRunResult | SingleRunResult | WorkspaceRunResult;
674
704
  interface RunOptions {
675
705
  cli: CliOptions;
676
706
  config: ResolvedConfig;
707
+ /**
708
+ * Span-tree profiler owned by `runJestRoblox`. Optional so direct test
709
+ * seams keep working with the existing two-property shape; production
710
+ * callers always pass one through.
711
+ */
712
+ timing?: TimingCollector;
677
713
  }
678
714
  //#endregion
679
715
  //#region src/run.d.ts
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { B as defineProject, C as formatFailure, F as JEST_ARGV_EXCLUDED_KEYS, I as ROOT_CLI_KEYS, L as SHARED_TEST_KEYS, M as resolveConfig, N as DEFAULT_CONFIG, O as extractJsonFromOutput, P as GLOBAL_TEST_KEYS, S as writeJsonFile, T as formatTestSummary, _ as runProjects, a as visitStatement, b as writeGameOutput, c as OpenCloudBackend, d as generateTestScript, g as formatExecuteOutput, h as formatJobSummary, i as visitExpression, j as loadConfig, k as parseJestOutput, l as createOpenCloudBackend, m as formatAnnotations, n as runTypecheck, o as StudioBackend, r as visitBlock, s as createStudioBackend, t as runJestRoblox, u as buildJestArgv, v as formatGameOutputNotice, w as formatResult, x as formatJson, y as parseGameOutput, z as defineConfig } from "./run-BEUPi80L.mjs";
1
+ import { A as extractJsonFromOutput, C as formatJson, D as formatTestSummary, E as formatResult, F as DEFAULT_CONFIG, H as defineProject, I as GLOBAL_TEST_KEYS, L as JEST_ARGV_EXCLUDED_KEYS, N as loadConfig, P as resolveConfig, R as ROOT_CLI_KEYS, S as writeGameOutput, T as formatFailure, V as defineConfig, _ as formatJobSummary, a as visitStatement, b as formatGameOutputNotice, c as OpenCloudBackend, f as buildJestArgv, g as formatAnnotations, i as visitExpression, j as parseJestOutput, l as createOpenCloudBackend, n as runTypecheck, o as StudioBackend, p as generateTestScript, r as visitBlock, s as createStudioBackend, t as runJestRoblox, v as formatExecuteOutput, w as writeJsonFile, x as parseGameOutput, y as runProjects, z as SHARED_TEST_KEYS } from "./run-CyHhajiY.mjs";
2
2
  export { DEFAULT_CONFIG, GLOBAL_TEST_KEYS, JEST_ARGV_EXCLUDED_KEYS, OpenCloudBackend, ROOT_CLI_KEYS, SHARED_TEST_KEYS, StudioBackend, buildJestArgv, createOpenCloudBackend, createStudioBackend, defineConfig, defineProject, extractJsonFromOutput, formatAnnotations, formatExecuteOutput, formatFailure, formatGameOutputNotice, formatJobSummary, formatJson, formatResult, formatTestSummary, generateTestScript, loadConfig, parseGameOutput, parseJestOutput, resolveConfig, runJestRoblox, runProjects, runTypecheck, visitBlock, visitExpression, visitStatement, writeGameOutput, writeJsonFile };