@isentinel/jest-roblox 0.2.7 → 0.3.1
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 +234 -46
- package/dist/cli.d.mts +2 -4
- package/dist/cli.mjs +113 -2812
- package/dist/index.d.mts +595 -40
- package/dist/index.mjs +2 -2
- package/dist/run-Cl5gYSQr.mjs +9945 -0
- package/dist/{executor-COuwZJJX.d.mts → schema-BpjBo-Aw.d.mts} +139 -301
- package/dist/sea-entry.cjs +40329 -40257
- package/package.json +29 -25
- package/plugin/JestRobloxRunner.rbxm +0 -0
- package/plugin/plugin.project.json +1 -1
- package/plugin/src/init.server.luau +39 -0
- package/plugin/src/test-in-run-mode.server.luau +117 -1
- package/dist/game-output-CCPIQMWm.mjs +0 -3643
- package/dist/sea/jest-roblox +0 -0
- package/plugin/out/shared/entry.luau +0 -9
- package/plugin/out/shared/instance-resolver.luau +0 -88
- package/plugin/out/shared/mock/CoreScriptSyncService.luau +0 -19
- package/plugin/out/shared/mock/FileSystemService.luau +0 -30
- package/plugin/out/shared/promise.luau +0 -2006
- package/plugin/out/shared/runner.luau +0 -301
- package/plugin/out/shared/setup-timing.luau +0 -89
- package/plugin/out/shared/snapshot-patch.luau +0 -94
|
@@ -1,68 +1,5 @@
|
|
|
1
1
|
import { ReportOptions } from "istanbul-reports";
|
|
2
2
|
|
|
3
|
-
//#region packages/rojo-utils/dist/index.d.mts
|
|
4
|
-
interface Mount {
|
|
5
|
-
dataModelPath: string;
|
|
6
|
-
fsPath: string;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region node_modules/.pnpm/@rbxts+jest@3.13.3-ts.1/node_modules/@rbxts/jest/src/config.d.ts
|
|
10
|
-
interface ReporterConfig {
|
|
11
|
-
reporter: string | ModuleScript;
|
|
12
|
-
options?: Record<string, any>;
|
|
13
|
-
}
|
|
14
|
-
type Argv = Partial<{
|
|
15
|
-
all: boolean;
|
|
16
|
-
automock: boolean;
|
|
17
|
-
bail: boolean | number;
|
|
18
|
-
changedSince: string;
|
|
19
|
-
ci: boolean;
|
|
20
|
-
clearCache: boolean;
|
|
21
|
-
clearMocks: boolean;
|
|
22
|
-
color: boolean;
|
|
23
|
-
colors: boolean;
|
|
24
|
-
config: string;
|
|
25
|
-
coverage: boolean;
|
|
26
|
-
debug: boolean;
|
|
27
|
-
env: string;
|
|
28
|
-
expand: boolean;
|
|
29
|
-
globals: string;
|
|
30
|
-
init: boolean;
|
|
31
|
-
injectGlobals: boolean;
|
|
32
|
-
json: boolean;
|
|
33
|
-
maxWorkers: number | string;
|
|
34
|
-
noStackTrace: boolean;
|
|
35
|
-
outputFile: string;
|
|
36
|
-
preset: string | undefined;
|
|
37
|
-
projects: Array<string>;
|
|
38
|
-
reporters: Array<string | ModuleScript | ReporterConfig>;
|
|
39
|
-
resetMocks: boolean;
|
|
40
|
-
resetModules: boolean;
|
|
41
|
-
restoreMocks: boolean;
|
|
42
|
-
rootDir: Instance;
|
|
43
|
-
roots: Array<string>;
|
|
44
|
-
runInBand: boolean;
|
|
45
|
-
selectProjects: Array<string>;
|
|
46
|
-
setupFiles: Array<ModuleScript>;
|
|
47
|
-
setupFilesAfterEnv: Array<ModuleScript>;
|
|
48
|
-
showConfig: boolean;
|
|
49
|
-
silent: boolean;
|
|
50
|
-
snapshotSerializers: Array<string>;
|
|
51
|
-
testEnvironment: string;
|
|
52
|
-
testEnvironmentOptions: string;
|
|
53
|
-
testFailureExitCode: string | undefined;
|
|
54
|
-
testMatch: Array<string>;
|
|
55
|
-
testNamePattern: string;
|
|
56
|
-
testPathIgnorePatterns: Array<string>;
|
|
57
|
-
testPathPattern: Array<string>;
|
|
58
|
-
testRegex: string | Array<string>;
|
|
59
|
-
testTimeout: number | undefined;
|
|
60
|
-
timers: string;
|
|
61
|
-
updateSnapshot: boolean;
|
|
62
|
-
verbose: boolean;
|
|
63
|
-
version: boolean;
|
|
64
|
-
}>;
|
|
65
|
-
//#endregion
|
|
66
3
|
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-any.d.ts
|
|
67
4
|
/**
|
|
68
5
|
Returns a boolean for whether the given type is `any`.
|
|
@@ -820,7 +757,7 @@ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends Excep
|
|
|
820
757
|
type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
|
|
821
758
|
//#endregion
|
|
822
759
|
//#region src/config/schema.d.ts
|
|
823
|
-
type Backend
|
|
760
|
+
type Backend = "auto" | "open-cloud" | "studio";
|
|
824
761
|
type CoverageReporter = keyof ReportOptions;
|
|
825
762
|
type FormatterEntry = [string, Record<string, unknown>] | string;
|
|
826
763
|
interface SnapshotFormatOptions {
|
|
@@ -833,45 +770,82 @@ interface SnapshotFormatOptions {
|
|
|
833
770
|
printBasicPrototype?: boolean;
|
|
834
771
|
printFunctionName?: boolean;
|
|
835
772
|
}
|
|
836
|
-
declare const ROOT_ONLY_KEYS: ReadonlySet<string>;
|
|
837
773
|
interface DisplayName {
|
|
838
774
|
name: string;
|
|
839
775
|
color: string;
|
|
840
776
|
}
|
|
841
|
-
|
|
777
|
+
/** Jest-passthrough keys valid both at `test:` and per-project. */
|
|
778
|
+
interface SharedTestConfig {
|
|
842
779
|
automock?: boolean;
|
|
843
780
|
clearMocks?: boolean;
|
|
844
|
-
displayName: DisplayName | string;
|
|
845
|
-
exclude?: Array<string>;
|
|
846
|
-
include: Array<string>;
|
|
847
781
|
injectGlobals?: boolean;
|
|
848
782
|
mockDataModel?: boolean;
|
|
849
|
-
outDir?: string;
|
|
850
783
|
resetMocks?: boolean;
|
|
851
784
|
resetModules?: boolean;
|
|
852
785
|
restoreMocks?: boolean;
|
|
853
|
-
root?: string;
|
|
854
786
|
setupFiles?: Array<string>;
|
|
855
787
|
setupFilesAfterEnv?: Array<string>;
|
|
856
788
|
slowTestThreshold?: number;
|
|
857
789
|
snapshotFormat?: SnapshotFormatOptions;
|
|
858
790
|
snapshotSerializers?: Array<string>;
|
|
859
791
|
testEnvironment?: string;
|
|
860
|
-
testEnvironmentOptions?: Record<string, unknown
|
|
792
|
+
testEnvironmentOptions?: Record<string, unknown> | string;
|
|
861
793
|
testMatch?: Array<string>;
|
|
862
794
|
testPathIgnorePatterns?: Array<string>;
|
|
863
795
|
testRegex?: Array<string> | string;
|
|
864
796
|
testTimeout?: number;
|
|
865
797
|
}
|
|
798
|
+
/** Jest-passthrough keys valid only per-project (under `projects[N].test`). */
|
|
799
|
+
interface ProjectTestConfig extends SharedTestConfig {
|
|
800
|
+
displayName: DisplayName | string;
|
|
801
|
+
exclude?: Array<string>;
|
|
802
|
+
include: Array<string>;
|
|
803
|
+
outDir?: string;
|
|
804
|
+
root?: string;
|
|
805
|
+
}
|
|
866
806
|
interface InlineProjectConfig {
|
|
867
807
|
test: ProjectTestConfig;
|
|
868
808
|
}
|
|
809
|
+
/** Workspace-only knobs. Ignored outside `--workspace` mode. */
|
|
810
|
+
interface WorkspaceConfig {
|
|
811
|
+
/**
|
|
812
|
+
* When `true`, emit one Per-package Game Output file per selected
|
|
813
|
+
* (package, project) under `<workspaceRoot>/.jest-roblox/output/`.
|
|
814
|
+
* Consensus-resolved across packages; only `true` is accepted.
|
|
815
|
+
*/
|
|
816
|
+
gameOutput?: true;
|
|
817
|
+
/**
|
|
818
|
+
* When `true`, emit one per-package result file (the Jest result JSON)
|
|
819
|
+
* per selected (package, project) under
|
|
820
|
+
* `<workspaceRoot>/.jest-roblox/output/`. Consensus-resolved across
|
|
821
|
+
* packages; only `true` is accepted.
|
|
822
|
+
*/
|
|
823
|
+
outputFile?: true;
|
|
824
|
+
/**
|
|
825
|
+
* Globs (relative to `root`) selecting package directories — each must
|
|
826
|
+
* contain a `jest.config.*`. Lets workspace mode enumerate packages in
|
|
827
|
+
* Luau-only / npm / yarn repos that have no `pnpm-workspace.yaml`.
|
|
828
|
+
* Required together with `root`; independent of `gameOutput`/`outputFile`.
|
|
829
|
+
*/
|
|
830
|
+
packages?: Array<string>;
|
|
831
|
+
/**
|
|
832
|
+
* The workspace root. Relative in source; resolved to an absolute path at
|
|
833
|
+
* load, anchored to the file that declares it (typically a shared config
|
|
834
|
+
* reached via `extends:`). Required together with `packages`.
|
|
835
|
+
*/
|
|
836
|
+
root?: string;
|
|
837
|
+
}
|
|
869
838
|
type ProjectEntry = InlineProjectConfig | string;
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
839
|
+
/** Jest-passthrough keys valid only at root `test:` (not per-project). */
|
|
840
|
+
interface GlobalTestConfig extends SharedTestConfig {
|
|
841
|
+
all?: boolean;
|
|
842
|
+
bail?: boolean | number;
|
|
843
|
+
changedSince?: string;
|
|
844
|
+
ci?: boolean;
|
|
845
|
+
clearCache?: boolean;
|
|
873
846
|
collectCoverage?: boolean;
|
|
874
847
|
collectCoverageFrom?: Array<string>;
|
|
848
|
+
coverage?: boolean;
|
|
875
849
|
coverageDirectory?: string;
|
|
876
850
|
coveragePathIgnorePatterns?: Array<string>;
|
|
877
851
|
coverageReporters?: Array<CoverageReporter>;
|
|
@@ -881,43 +855,92 @@ interface Config extends Except<Argv, "projects" | "rootDir" | "setupFiles" | "s
|
|
|
881
855
|
lines?: number;
|
|
882
856
|
statements?: number;
|
|
883
857
|
};
|
|
858
|
+
debug?: boolean;
|
|
859
|
+
displayName?: DisplayName | string;
|
|
860
|
+
env?: string;
|
|
861
|
+
exclude?: Array<string>;
|
|
862
|
+
expand?: boolean;
|
|
863
|
+
globals?: string;
|
|
864
|
+
include?: Array<string>;
|
|
865
|
+
maxWorkers?: number | string;
|
|
866
|
+
noStackTrace?: boolean;
|
|
867
|
+
outDir?: string;
|
|
868
|
+
passWithNoTests?: boolean;
|
|
869
|
+
preset?: string;
|
|
870
|
+
projects?: Array<ProjectEntry>;
|
|
871
|
+
reporters?: Array<string>;
|
|
872
|
+
roots?: Array<string>;
|
|
873
|
+
runInBand?: boolean;
|
|
874
|
+
selectProjects?: Array<string>;
|
|
875
|
+
showConfig?: boolean;
|
|
876
|
+
silent?: boolean;
|
|
877
|
+
testFailureExitCode?: string;
|
|
878
|
+
testNamePattern?: string;
|
|
879
|
+
testPathPattern?: string;
|
|
880
|
+
timers?: string;
|
|
881
|
+
updateSnapshot?: boolean;
|
|
882
|
+
verbose?: boolean;
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Root-level config: CLI/runner keys plus the `test:` block where all
|
|
886
|
+
* jest-passthrough options live.
|
|
887
|
+
*/
|
|
888
|
+
interface Config {
|
|
889
|
+
backend?: Backend;
|
|
890
|
+
color?: boolean;
|
|
891
|
+
coverageCache?: boolean;
|
|
884
892
|
extends?: Array<string> | string;
|
|
885
893
|
formatters?: Array<FormatterEntry>;
|
|
886
|
-
|
|
894
|
+
/**
|
|
895
|
+
* Where to write Game Output. A path, or `true` to default to
|
|
896
|
+
* `game-output.log` under the root. In workspace mode this becomes the
|
|
897
|
+
* single Aggregated Game Output file (consensus-resolved).
|
|
898
|
+
*/
|
|
899
|
+
gameOutput?: string | true;
|
|
887
900
|
jestPath?: string;
|
|
888
901
|
luauRoots?: Array<string>;
|
|
902
|
+
/**
|
|
903
|
+
* Where to write the Jest result JSON. A path, or `true` to default to
|
|
904
|
+
* `jest-output.log` under the root. In workspace mode this becomes the
|
|
905
|
+
* single aggregated result file (consensus-resolved).
|
|
906
|
+
*/
|
|
907
|
+
outputFile?: string | true;
|
|
889
908
|
parallel?: "auto" | number;
|
|
890
|
-
passWithNoTests?: boolean;
|
|
891
909
|
placeFile?: string;
|
|
892
|
-
|
|
910
|
+
placeId?: string;
|
|
893
911
|
port?: number;
|
|
894
|
-
projects?: Array<ProjectEntry>;
|
|
895
|
-
reporters?: Array<string>;
|
|
896
912
|
rojoProject?: string;
|
|
897
913
|
rootDir?: string;
|
|
898
|
-
setupFiles?: Array<string>;
|
|
899
|
-
setupFilesAfterEnv?: Array<string>;
|
|
900
914
|
showLuau?: boolean;
|
|
901
|
-
snapshotFormat?: SnapshotFormatOptions;
|
|
902
915
|
sourceMap?: boolean;
|
|
903
|
-
|
|
916
|
+
test?: GlobalTestConfig;
|
|
904
917
|
timeout?: number;
|
|
905
918
|
typecheck?: boolean;
|
|
906
919
|
typecheckOnly?: boolean;
|
|
907
920
|
typecheckTsconfig?: string;
|
|
908
|
-
|
|
921
|
+
universeId?: string;
|
|
922
|
+
workspace?: WorkspaceConfig;
|
|
909
923
|
}
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
924
|
+
/**
|
|
925
|
+
* Resolved config flattens the root CLI keys with the `test:` jest options
|
|
926
|
+
* so downstream code (executor, projects, test-script, formatters) can read
|
|
927
|
+
* options uniformly. Refactoring those consumers to read `config.test.foo`
|
|
928
|
+
* is follow-up work; this shape lets the structural split land first.
|
|
929
|
+
*/
|
|
930
|
+
interface ResolvedConfig extends Except<Config, "test">, Except<GlobalTestConfig, "projects"> {
|
|
931
|
+
backend: Backend;
|
|
913
932
|
collectCoverage: boolean;
|
|
914
933
|
color: boolean;
|
|
934
|
+
coverageCache: boolean;
|
|
915
935
|
coverageDirectory: string;
|
|
916
936
|
coveragePathIgnorePatterns: Array<string>;
|
|
917
937
|
coverageReporters: Array<CoverageReporter>;
|
|
938
|
+
/** `true` is expanded to `<rootDir>/game-output.log` at resolve time; an explicit path is kept as-is. */
|
|
939
|
+
gameOutput?: string;
|
|
940
|
+
/** `true` is expanded to `<rootDir>/jest-output.log` at resolve time; an explicit path is kept as-is. */
|
|
941
|
+
outputFile?: string;
|
|
918
942
|
passWithNoTests: boolean;
|
|
919
943
|
placeFile: string;
|
|
920
|
-
pollInterval: number;
|
|
921
944
|
port: number;
|
|
922
945
|
projects?: Array<string>;
|
|
923
946
|
rootDir: string;
|
|
@@ -936,12 +959,14 @@ type MergerFunction<T> = (defaults: T) => T;
|
|
|
936
959
|
type Mergeable<T> = MergerFunction<T> | T;
|
|
937
960
|
declare const DEFAULT_CONFIG: ResolvedConfig;
|
|
938
961
|
interface CliOptions {
|
|
939
|
-
|
|
940
|
-
|
|
962
|
+
affectedSince?: string;
|
|
963
|
+
apiKey?: string;
|
|
964
|
+
backend?: Backend;
|
|
941
965
|
collectCoverage?: boolean;
|
|
942
966
|
collectCoverageFrom?: Array<string>;
|
|
943
967
|
color?: boolean;
|
|
944
968
|
config?: string;
|
|
969
|
+
coverageCache?: boolean;
|
|
945
970
|
coverageDirectory?: string;
|
|
946
971
|
coverageReporters?: Array<CoverageReporter>;
|
|
947
972
|
files?: Array<string>;
|
|
@@ -949,9 +974,10 @@ interface CliOptions {
|
|
|
949
974
|
gameOutput?: string;
|
|
950
975
|
help?: boolean;
|
|
951
976
|
outputFile?: string;
|
|
977
|
+
packages?: string;
|
|
952
978
|
parallel?: "auto" | number;
|
|
953
979
|
passWithNoTests?: boolean;
|
|
954
|
-
|
|
980
|
+
placeId?: string;
|
|
955
981
|
port?: number;
|
|
956
982
|
project?: Array<string>;
|
|
957
983
|
reporters?: Array<string>;
|
|
@@ -967,222 +993,34 @@ interface CliOptions {
|
|
|
967
993
|
typecheck?: boolean;
|
|
968
994
|
typecheckOnly?: boolean;
|
|
969
995
|
typecheckTsconfig?: string;
|
|
996
|
+
universeId?: string;
|
|
970
997
|
updateSnapshot?: boolean;
|
|
971
998
|
verbose?: boolean;
|
|
972
999
|
version?: boolean;
|
|
1000
|
+
workspace?: boolean;
|
|
1001
|
+
/** Directory to load the workspace config from when run outside a package. */
|
|
1002
|
+
workspaceRoot?: string;
|
|
973
1003
|
}
|
|
974
|
-
interface ConfigInput extends Except<Config, "
|
|
975
|
-
collectCoverageFrom?: Mergeable<Array<string>>;
|
|
976
|
-
coveragePathIgnorePatterns?: Mergeable<Array<string>>;
|
|
977
|
-
coverageReporters?: Mergeable<Array<CoverageReporter>>;
|
|
1004
|
+
interface ConfigInput extends Except<Config, "formatters" | "luauRoots" | "test"> {
|
|
978
1005
|
formatters?: Mergeable<Array<FormatterEntry>>;
|
|
979
1006
|
luauRoots?: Mergeable<Array<string>>;
|
|
980
|
-
|
|
981
|
-
setupFiles?: Mergeable<Array<string>>;
|
|
982
|
-
setupFilesAfterEnv?: Mergeable<Array<string>>;
|
|
983
|
-
testMatch?: Mergeable<Array<string>>;
|
|
984
|
-
testPathIgnorePatterns?: Mergeable<Array<string>>;
|
|
985
|
-
}
|
|
986
|
-
declare const defineConfig: (input: ConfigInput) => ConfigInput;
|
|
987
|
-
declare const defineProject: (input: ProjectTestConfig) => ProjectTestConfig;
|
|
988
|
-
//#endregion
|
|
989
|
-
//#region src/config/projects.d.ts
|
|
990
|
-
interface ResolvedProjectConfig {
|
|
991
|
-
config: ResolvedConfig;
|
|
992
|
-
displayColor?: string;
|
|
993
|
-
displayName: string;
|
|
994
|
-
/** Original include patterns (with TS extensions) for filesystem discovery. */
|
|
995
|
-
include: Array<string>;
|
|
996
|
-
/**
|
|
997
|
-
* Single resolved output directory (workspace-relative). Set only when
|
|
998
|
-
* resolution produced exactly one mount; undefined when the project spans
|
|
999
|
-
* multiple rojo mounts. Kept for back-compat; new code should consume
|
|
1000
|
-
* `rojoMounts` instead.
|
|
1001
|
-
*/
|
|
1002
|
-
outDir?: string;
|
|
1003
|
-
/** DataModel paths Jest walks up from to discover test configs. */
|
|
1004
|
-
projects: Array<string>;
|
|
1005
|
-
/** Internal: FS↔DataModel pairs for stub generation and shadow sync. */
|
|
1006
|
-
rojoMounts: Array<Mount>;
|
|
1007
|
-
/** Luau-side testMatch patterns (extensions stripped). */
|
|
1008
|
-
testMatch: Array<string>;
|
|
1009
|
-
}
|
|
1010
|
-
//#endregion
|
|
1011
|
-
//#region src/coverage/types.d.ts
|
|
1012
|
-
/**
|
|
1013
|
-
* Raw hit counts for a single file, keyed by statement/function index.
|
|
1014
|
-
*/
|
|
1015
|
-
interface RawFileCoverage {
|
|
1016
|
-
b?: Record<string, Array<number>>;
|
|
1017
|
-
f?: Record<string, number>;
|
|
1018
|
-
s: Record<string, number>;
|
|
1019
|
-
}
|
|
1020
|
-
/**
|
|
1021
|
-
* Raw coverage data for all files, keyed by original Luau-relative path.
|
|
1022
|
-
*/
|
|
1023
|
-
type RawCoverageData = Record<string, RawFileCoverage>;
|
|
1024
|
-
//#endregion
|
|
1025
|
-
//#region src/types/jest-result.d.ts
|
|
1026
|
-
type TestStatus = "disabled" | "failed" | "passed" | "pending" | "skipped" | "todo";
|
|
1027
|
-
interface TestCaseResult {
|
|
1028
|
-
ancestorTitles: Array<string>;
|
|
1029
|
-
duration?: number;
|
|
1030
|
-
failureMessages: Array<string>;
|
|
1031
|
-
fullName: string;
|
|
1032
|
-
location?: {
|
|
1033
|
-
column: number;
|
|
1034
|
-
line: number;
|
|
1035
|
-
};
|
|
1036
|
-
numPassingAsserts?: number;
|
|
1037
|
-
retryReasons?: Array<string>;
|
|
1038
|
-
status: TestStatus;
|
|
1039
|
-
title: string;
|
|
1040
|
-
}
|
|
1041
|
-
interface TestFileResult {
|
|
1042
|
-
failureMessage?: string;
|
|
1043
|
-
numFailingTests: number;
|
|
1044
|
-
numPassingTests: number;
|
|
1045
|
-
numPendingTests: number;
|
|
1046
|
-
testFilePath: string;
|
|
1047
|
-
testResults: Array<TestCaseResult>;
|
|
1048
|
-
}
|
|
1049
|
-
interface SnapshotSummary {
|
|
1050
|
-
added: number;
|
|
1051
|
-
matched: number;
|
|
1052
|
-
total: number;
|
|
1053
|
-
unmatched: number;
|
|
1054
|
-
updated: number;
|
|
1007
|
+
test?: GlobalTestConfigInput;
|
|
1055
1008
|
}
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
startTime: number;
|
|
1064
|
-
success: boolean;
|
|
1065
|
-
testResults: Array<TestFileResult>;
|
|
1066
|
-
}
|
|
1067
|
-
//#endregion
|
|
1068
|
-
//#region src/reporter/parser.d.ts
|
|
1069
|
-
type SnapshotWrites = Record<string, string>;
|
|
1070
|
-
interface ParseResult {
|
|
1071
|
-
coverageData?: RawCoverageData;
|
|
1072
|
-
luauTiming?: Record<string, number>;
|
|
1073
|
-
result: JestResult;
|
|
1074
|
-
setupSeconds?: number;
|
|
1075
|
-
snapshotWrites?: SnapshotWrites;
|
|
1076
|
-
}
|
|
1077
|
-
declare function extractJsonFromOutput(output: string): string | undefined;
|
|
1078
|
-
declare function parseJestOutput(output: string): ParseResult;
|
|
1079
|
-
//#endregion
|
|
1080
|
-
//#region src/backends/interface.d.ts
|
|
1081
|
-
interface ProjectJob {
|
|
1082
|
-
config: ResolvedConfig;
|
|
1083
|
-
displayColor?: string;
|
|
1084
|
-
displayName: string;
|
|
1085
|
-
testFiles: Array<string>;
|
|
1086
|
-
}
|
|
1087
|
-
interface BackendOptions {
|
|
1088
|
-
jobs: Array<ProjectJob>;
|
|
1089
|
-
/**
|
|
1090
|
-
* Open-Cloud-only: number of concurrent Open Cloud Luau execution sessions
|
|
1091
|
-
* to fire. Unset or 1 means one session carrying all jobs. `"auto"` resolves
|
|
1092
|
-
* to min(jobs.length, 3). Studio backend must error when this is set to
|
|
1093
|
-
* anything other than undefined/1 (Phase 4 enforces at the CLI layer).
|
|
1094
|
-
*/
|
|
1095
|
-
parallel?: "auto" | number;
|
|
1096
|
-
}
|
|
1097
|
-
interface BackendTiming {
|
|
1098
|
-
executionMs: number;
|
|
1099
|
-
uploadCached?: boolean;
|
|
1100
|
-
uploadMs?: number;
|
|
1101
|
-
}
|
|
1102
|
-
interface ProjectBackendResult {
|
|
1103
|
-
coverageData?: RawCoverageData;
|
|
1104
|
-
displayColor?: string;
|
|
1105
|
-
displayName: string;
|
|
1106
|
-
elapsedMs: number;
|
|
1107
|
-
gameOutput?: string;
|
|
1108
|
-
luauTiming?: Record<string, number>;
|
|
1109
|
-
result: JestResult;
|
|
1110
|
-
setupMs?: number;
|
|
1111
|
-
snapshotWrites?: SnapshotWrites;
|
|
1112
|
-
}
|
|
1113
|
-
interface BackendResult {
|
|
1114
|
-
results: Array<ProjectBackendResult>;
|
|
1115
|
-
timing: BackendTiming;
|
|
1116
|
-
}
|
|
1117
|
-
type BackendKind = "open-cloud" | "studio";
|
|
1118
|
-
interface Backend {
|
|
1119
|
-
close?(): Promise<void> | void;
|
|
1120
|
-
readonly kind: BackendKind;
|
|
1121
|
-
runTests(options: BackendOptions): Promise<BackendResult>;
|
|
1122
|
-
}
|
|
1123
|
-
//#endregion
|
|
1124
|
-
//#region src/source-mapper/index.d.ts
|
|
1125
|
-
interface MappedLocation {
|
|
1126
|
-
luauLine: number;
|
|
1127
|
-
luauPath: string;
|
|
1128
|
-
sourceContent?: string;
|
|
1129
|
-
tsColumn?: number;
|
|
1130
|
-
tsLine?: number;
|
|
1131
|
-
tsPath?: string;
|
|
1132
|
-
}
|
|
1133
|
-
interface MappedFailure {
|
|
1134
|
-
locations: Array<MappedLocation>;
|
|
1135
|
-
message: string;
|
|
1136
|
-
}
|
|
1137
|
-
interface SourceMapper {
|
|
1138
|
-
mapFailureMessage(message: string): string;
|
|
1139
|
-
mapFailureWithLocations(message: string): MappedFailure;
|
|
1140
|
-
resolveTestFilePath(testFilePath: string): string | undefined;
|
|
1141
|
-
}
|
|
1142
|
-
//#endregion
|
|
1143
|
-
//#region src/types/timing.d.ts
|
|
1144
|
-
interface TimingResult {
|
|
1145
|
-
coverageMs?: number;
|
|
1146
|
-
executionMs: number;
|
|
1147
|
-
setupMs?: number;
|
|
1148
|
-
startTime: number;
|
|
1149
|
-
testsMs: number;
|
|
1150
|
-
totalMs: number;
|
|
1151
|
-
uploadCached?: boolean;
|
|
1152
|
-
uploadMs?: number;
|
|
1153
|
-
}
|
|
1154
|
-
//#endregion
|
|
1155
|
-
//#region src/executor.d.ts
|
|
1156
|
-
interface ExecuteOptions {
|
|
1157
|
-
backend: Backend;
|
|
1158
|
-
config: ResolvedConfig;
|
|
1159
|
-
deferFormatting?: boolean;
|
|
1160
|
-
testFiles: Array<string>;
|
|
1161
|
-
version: string;
|
|
1162
|
-
}
|
|
1163
|
-
interface ExecuteResult {
|
|
1164
|
-
coverageData?: RawCoverageData;
|
|
1165
|
-
exitCode: number;
|
|
1166
|
-
gameOutput?: string;
|
|
1167
|
-
output: string;
|
|
1168
|
-
result: JestResult;
|
|
1169
|
-
sourceMapper?: SourceMapper;
|
|
1170
|
-
timing: TimingResult;
|
|
1171
|
-
}
|
|
1172
|
-
interface FormatOutputOptions {
|
|
1173
|
-
config: ResolvedConfig;
|
|
1174
|
-
result: JestResult;
|
|
1175
|
-
sourceMapper?: SourceMapper;
|
|
1176
|
-
timing: TimingResult;
|
|
1177
|
-
version: string;
|
|
1178
|
-
}
|
|
1179
|
-
declare function formatExecuteOutput(options: FormatOutputOptions): string;
|
|
1009
|
+
type MergeableTestKey = "collectCoverageFrom" | "coveragePathIgnorePatterns" | "coverageReporters" | "coverageThreshold" | "reporters" | "roots" | "selectProjects" | "setupFiles" | "setupFilesAfterEnv" | "snapshotFormat" | "snapshotSerializers" | "testMatch" | "testPathIgnorePatterns";
|
|
1010
|
+
type GlobalTestConfigInput = Except<GlobalTestConfig, MergeableTestKey> & { [K in MergeableTestKey]?: Mergeable<NonNullable<GlobalTestConfig[K]>> };
|
|
1011
|
+
declare const SHARED_TEST_KEYS: ReadonlySet<string>;
|
|
1012
|
+
/** Keys valid in `test:` (root) but not per-project (`projects[N].test`). */
|
|
1013
|
+
declare const GLOBAL_TEST_KEYS: ReadonlySet<string>;
|
|
1014
|
+
/** Root-level CLI/runner keys. The complement of `test:` jest-passthrough keys. */
|
|
1015
|
+
declare const ROOT_CLI_KEYS: ReadonlySet<string>;
|
|
1180
1016
|
/**
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1183
|
-
*
|
|
1184
|
-
*
|
|
1017
|
+
* Keys excluded from jest argv when building the test runner script. Includes
|
|
1018
|
+
* all CLI/runner-level keys plus the coverage keys, which live under `test:`
|
|
1019
|
+
* by config shape but are consumed by the runner's lute-based coverage layer
|
|
1020
|
+
* (not jest itself).
|
|
1185
1021
|
*/
|
|
1186
|
-
declare
|
|
1022
|
+
declare const JEST_ARGV_EXCLUDED_KEYS: ReadonlySet<string>;
|
|
1023
|
+
declare const defineConfig: (input: ConfigInput) => ConfigInput;
|
|
1024
|
+
declare const defineProject: (input: InlineProjectConfig) => InlineProjectConfig;
|
|
1187
1025
|
//#endregion
|
|
1188
|
-
export {
|
|
1026
|
+
export { SnapshotFormatOptions as _, DisplayName as a, defineProject as b, GlobalTestConfig as c, ProjectEntry as d, ProjectTestConfig as f, SharedTestConfig as g, SHARED_TEST_KEYS as h, DEFAULT_CONFIG as i, InlineProjectConfig as l, ResolvedConfig as m, Config as n, FormatterEntry as o, ROOT_CLI_KEYS as p, ConfigInput as r, GLOBAL_TEST_KEYS as s, CliOptions as t, JEST_ARGV_EXCLUDED_KEYS as u, WorkspaceConfig as v, defineConfig as y };
|