1 | import type { LogLevel, TaskCommand } from '../internal/index';
|
2 |
|
3 |
|
4 |
|
5 | export declare const BOOLEAN_CLI_FLAGS: readonly ["build", "cache", "checkVersion", "ci", "compare", "debug", "dev", "devtools", "docs", "e2e", "es5", "esm", "help", "log", "open", "prerender", "prerenderExternal", "prod", "profile", "serviceWorker", "screenshot", "serve", "skipNodeCheck", "spec", "ssr", "stats", "updateScreenshot", "verbose", "version", "watch", "all", "automock", "bail", "changedFilesWithAncestor", "clearCache", "clearMocks", "collectCoverage", "color", "colors", "coverage", "detectLeaks", "detectOpenHandles", "errorOnDeprecated", "expand", "findRelatedTests", "forceExit", "init", "injectGlobals", "json", "lastCommit", "listTests", "logHeapUsage", "noStackTrace", "notify", "onlyChanged", "onlyFailures", "passWithNoTests", "resetMocks", "resetModules", "restoreMocks", "runInBand", "runTestsByPath", "showConfig", "silent", "skipFilter", "testLocationInResults", "updateSnapshot", "useStderr", "watchAll", "watchman"];
|
6 |
|
7 |
|
8 |
|
9 | export declare const NUMBER_CLI_FLAGS: readonly ["port", "maxConcurrency", "testTimeout"];
|
10 |
|
11 |
|
12 |
|
13 | export declare const STRING_CLI_FLAGS: readonly ["address", "config", "docsApi", "docsJson", "emulate", "root", "screenshotConnector", "cacheDirectory", "changedSince", "collectCoverageFrom", "coverageDirectory", "coverageThreshold", "env", "filter", "globalSetup", "globalTeardown", "globals", "haste", "moduleNameMapper", "notifyMode", "outputFile", "preset", "prettierPath", "resolver", "rootDir", "runner", "testEnvironment", "testEnvironmentOptions", "testFailureExitCode", "testNamePattern", "testResultsProcessor", "testRunner", "testSequencer", "testURL", "timers", "transform"];
|
14 | export declare const STRING_ARRAY_CLI_FLAGS: readonly ["collectCoverageOnlyFrom", "coveragePathIgnorePatterns", "coverageReporters", "moduleDirectories", "moduleFileExtensions", "modulePathIgnorePatterns", "modulePaths", "projects", "reporters", "roots", "selectProjects", "setupFiles", "setupFilesAfterEnv", "snapshotSerializers", "testMatch", "testPathIgnorePatterns", "testPathPattern", "testRegex", "transformIgnorePatterns", "unmockedModulePathPatterns", "watchPathIgnorePatterns"];
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | export declare const STRING_NUMBER_CLI_FLAGS: readonly ["maxWorkers"];
|
22 |
|
23 |
|
24 |
|
25 | export declare const BOOLEAN_STRING_CLI_FLAGS: readonly ["headless"];
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export declare const LOG_LEVEL_CLI_FLAGS: readonly ["logLevel"];
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | type ArrayValuesAsUnion<T extends ReadonlyArray<string>> = T[number];
|
40 | export type BooleanCLIFlag = ArrayValuesAsUnion<typeof BOOLEAN_CLI_FLAGS>;
|
41 | export type StringCLIFlag = ArrayValuesAsUnion<typeof STRING_CLI_FLAGS>;
|
42 | export type StringArrayCLIFlag = ArrayValuesAsUnion<typeof STRING_ARRAY_CLI_FLAGS>;
|
43 | export type NumberCLIFlag = ArrayValuesAsUnion<typeof NUMBER_CLI_FLAGS>;
|
44 | export type StringNumberCLIFlag = ArrayValuesAsUnion<typeof STRING_NUMBER_CLI_FLAGS>;
|
45 | export type BooleanStringCLIFlag = ArrayValuesAsUnion<typeof BOOLEAN_STRING_CLI_FLAGS>;
|
46 | export type LogCLIFlag = ArrayValuesAsUnion<typeof LOG_LEVEL_CLI_FLAGS>;
|
47 | export type KnownCLIFlag = BooleanCLIFlag | StringCLIFlag | StringArrayCLIFlag | NumberCLIFlag | StringNumberCLIFlag | BooleanStringCLIFlag | LogCLIFlag;
|
48 | type AliasMap = Partial<Record<string, KnownCLIFlag>>;
|
49 |
|
50 |
|
51 |
|
52 | export declare const CLI_FLAG_ALIASES: AliasMap;
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | export declare const CLI_FLAG_REGEX: RegExp;
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | type ObjectFromKeys<K extends ReadonlyArray<string>, T> = {
|
67 | [key in K[number]]?: T | null;
|
68 | };
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | type BooleanConfigFlags = ObjectFromKeys<typeof BOOLEAN_CLI_FLAGS, boolean>;
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | type StringConfigFlags = ObjectFromKeys<typeof STRING_CLI_FLAGS, string>;
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | type StringArrayConfigFlags = ObjectFromKeys<typeof STRING_ARRAY_CLI_FLAGS, string[]>;
|
84 |
|
85 |
|
86 |
|
87 |
|
88 | type NumberConfigFlags = ObjectFromKeys<typeof NUMBER_CLI_FLAGS, number>;
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | type StringNumberConfigFlags = ObjectFromKeys<typeof STRING_NUMBER_CLI_FLAGS, string | number>;
|
94 |
|
95 |
|
96 |
|
97 |
|
98 | type BooleanStringConfigFlags = ObjectFromKeys<typeof BOOLEAN_STRING_CLI_FLAGS, boolean | string>;
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | type LogLevelFlags = ObjectFromKeys<typeof LOG_LEVEL_CLI_FLAGS, LogLevel>;
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 | export interface ConfigFlags extends BooleanConfigFlags, StringConfigFlags, StringArrayConfigFlags, NumberConfigFlags, StringNumberConfigFlags, BooleanStringConfigFlags, LogLevelFlags {
|
119 | task: TaskCommand | null;
|
120 | args: string[];
|
121 | knownArgs: string[];
|
122 | unknownArgs: string[];
|
123 | }
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 | export declare const createConfigFlags: (init?: Partial<ConfigFlags>) => ConfigFlags;
|
132 | export {};
|