9
9
10
10
import { type Static , Type } from '@sinclair/typebox' ;
11
11
12
- export const RawSnapshotFormat = Type . Partial (
12
+ export const SnapshotFormat = Type . Partial (
13
13
Type . Object ( {
14
14
callToJSON : Type . Boolean ( ) ,
15
15
compareKeys : Type . Null ( ) ,
@@ -34,12 +34,12 @@ export const RawSnapshotFormat = Type.Partial(
34
34
} ) ,
35
35
) ;
36
36
37
- const RawCoverageProvider = Type . Union ( [
37
+ const CoverageProvider = Type . Union ( [
38
38
Type . Literal ( 'babel' ) ,
39
39
Type . Literal ( 'v8' ) ,
40
40
] ) ;
41
41
42
- const RawCoverageThresholdValue = Type . Partial (
42
+ const CoverageThresholdValue = Type . Partial (
43
43
Type . Object ( {
44
44
branches : Type . Number ( { minimum : 0 , maximum : 100 } ) ,
45
45
functions : Type . Number ( { minimum : 0 , maximum : 100 } ) ,
@@ -48,15 +48,15 @@ const RawCoverageThresholdValue = Type.Partial(
48
48
} ) ,
49
49
) ;
50
50
51
- const RawCoverageThresholdBase = Type . Object (
52
- { global : RawCoverageThresholdValue } ,
53
- { additionalProperties : RawCoverageThresholdValue } ,
51
+ const CoverageThresholdBase = Type . Object (
52
+ { global : CoverageThresholdValue } ,
53
+ { additionalProperties : CoverageThresholdValue } ,
54
54
) ;
55
55
56
- const RawCoverageThreshold = Type . Unsafe < {
57
- global : Static < typeof RawCoverageThresholdValue > ;
58
- [ path : string ] : Static < typeof RawCoverageThresholdValue > ;
59
- } > ( RawCoverageThresholdBase ) ;
56
+ const CoverageThreshold = Type . Unsafe < {
57
+ global : Static < typeof CoverageThresholdValue > ;
58
+ [ path : string ] : Static < typeof CoverageThresholdValue > ;
59
+ } > ( CoverageThresholdBase ) ;
60
60
61
61
// TODO: add type test that these are all the colors available in chalk.ForegroundColor
62
62
export const ChalkForegroundColors = Type . Union ( [
@@ -80,13 +80,13 @@ export const ChalkForegroundColors = Type.Union([
80
80
Type . Literal ( 'whiteBright' ) ,
81
81
] ) ;
82
82
83
- const RawDisplayName = Type . Object ( {
83
+ const DisplayName = Type . Object ( {
84
84
name : Type . String ( ) ,
85
85
color : ChalkForegroundColors ,
86
86
} ) ;
87
87
88
88
// TODO: verify these are the names of istanbulReport.ReportOptions
89
- export const RawCoverageReporterNames = Type . Union ( [
89
+ export const CoverageReporterNames = Type . Union ( [
90
90
Type . Literal ( 'clover' ) ,
91
91
Type . Literal ( 'cobertura' ) ,
92
92
Type . Literal ( 'html-spa' ) ,
@@ -102,17 +102,17 @@ export const RawCoverageReporterNames = Type.Union([
102
102
Type . Literal ( 'text-summary' ) ,
103
103
] ) ;
104
104
105
- const RawCoverageReporters = Type . Array (
105
+ const CoverageReporters = Type . Array (
106
106
Type . Union ( [
107
- RawCoverageReporterNames ,
107
+ CoverageReporterNames ,
108
108
Type . Tuple ( [
109
- RawCoverageReporterNames ,
109
+ CoverageReporterNames ,
110
110
Type . Record ( Type . String ( ) , Type . Unknown ( ) ) ,
111
111
] ) ,
112
112
] ) ,
113
113
) ;
114
114
115
- const RawGlobalFakeTimersConfig = Type . Partial (
115
+ const GlobalFakeTimersConfig = Type . Partial (
116
116
Type . Object ( {
117
117
enableGlobally : Type . Boolean ( {
118
118
description :
@@ -122,7 +122,7 @@ const RawGlobalFakeTimersConfig = Type.Partial(
122
122
} ) ,
123
123
) ;
124
124
125
- const RawFakeableAPI = Type . Union ( [
125
+ const FakeableAPI = Type . Union ( [
126
126
Type . Literal ( 'Date' ) ,
127
127
Type . Literal ( 'hrtime' ) ,
128
128
Type . Literal ( 'nextTick' ) ,
@@ -140,15 +140,15 @@ const RawFakeableAPI = Type.Union([
140
140
Type . Literal ( 'clearTimeout' ) ,
141
141
] ) ;
142
142
143
- const RawFakeTimersConfig = Type . Partial (
143
+ const FakeTimersConfig = Type . Partial (
144
144
Type . Object ( {
145
145
advanceTimers : Type . Union ( [ Type . Boolean ( ) , Type . Number ( { minimum : 0 } ) ] , {
146
146
description :
147
147
'If set to `true` all timers will be advanced automatically by 20 milliseconds every 20 milliseconds. A custom ' +
148
148
'time delta may be provided by passing a number.' ,
149
149
default : false ,
150
150
} ) ,
151
- doNotFake : Type . Array ( RawFakeableAPI , {
151
+ doNotFake : Type . Array ( FakeableAPI , {
152
152
description :
153
153
'List of names of APIs (e.g. `Date`, `nextTick()`, `setImmediate()`, `setTimeout()`) that should not be faked.' +
154
154
'\n\nThe default is `[]`, meaning all APIs are faked.' ,
@@ -173,7 +173,7 @@ const RawFakeTimersConfig = Type.Partial(
173
173
} ) ,
174
174
) ;
175
175
176
- const RawLegacyFakeTimersConfig = Type . Partial (
176
+ const LegacyFakeTimersConfig = Type . Partial (
177
177
Type . Object ( {
178
178
legacyFakeTimers : Type . Literal ( true , {
179
179
description :
@@ -183,12 +183,12 @@ const RawLegacyFakeTimersConfig = Type.Partial(
183
183
} ) ,
184
184
) ;
185
185
186
- export const RawFakeTimers = Type . Intersect ( [
187
- RawGlobalFakeTimersConfig ,
188
- Type . Union ( [ RawFakeTimersConfig , RawLegacyFakeTimersConfig ] ) ,
186
+ export const FakeTimers = Type . Intersect ( [
187
+ GlobalFakeTimersConfig ,
188
+ Type . Union ( [ FakeTimersConfig , LegacyFakeTimersConfig ] ) ,
189
189
] ) ;
190
190
191
- const RawHasteConfig = Type . Partial (
191
+ const HasteConfig = Type . Partial (
192
192
Type . Object ( {
193
193
computeSha1 : Type . Boolean ( {
194
194
description : 'Whether to hash files using SHA-1.' ,
@@ -225,7 +225,7 @@ const RawHasteConfig = Type.Partial(
225
225
} ) ,
226
226
) ;
227
227
228
- export const RawInitialOptions = Type . Partial (
228
+ export const InitialOptions = Type . Partial (
229
229
Type . Object ( {
230
230
automock : Type . Boolean ( ) ,
231
231
bail : Type . Union ( [ Type . Boolean ( ) , Type . Number ( ) ] ) ,
@@ -239,16 +239,16 @@ export const RawInitialOptions = Type.Partial(
239
239
collectCoverageFrom : Type . Array ( Type . String ( ) ) ,
240
240
coverageDirectory : Type . String ( ) ,
241
241
coveragePathIgnorePatterns : Type . Array ( Type . String ( ) ) ,
242
- coverageProvider : RawCoverageProvider ,
243
- coverageReporters : RawCoverageReporters ,
244
- coverageThreshold : RawCoverageThreshold ,
242
+ coverageProvider : CoverageProvider ,
243
+ coverageReporters : CoverageReporters ,
244
+ coverageThreshold : CoverageThreshold ,
245
245
dependencyExtractor : Type . String ( ) ,
246
246
detectLeaks : Type . Boolean ( ) ,
247
247
detectOpenHandles : Type . Boolean ( ) ,
248
- displayName : Type . Union ( [ Type . String ( ) , RawDisplayName ] ) ,
248
+ displayName : Type . Union ( [ Type . String ( ) , DisplayName ] ) ,
249
249
expand : Type . Boolean ( ) ,
250
250
extensionsToTreatAsEsm : Type . Array ( Type . String ( ) ) ,
251
- fakeTimers : RawFakeTimers ,
251
+ fakeTimers : FakeTimers ,
252
252
filter : Type . String ( ) ,
253
253
findRelatedTests : Type . Boolean ( ) ,
254
254
forceCoverageMatch : Type . Array ( Type . String ( ) ) ,
@@ -257,7 +257,7 @@ export const RawInitialOptions = Type.Partial(
257
257
globals : Type . Record ( Type . String ( ) , Type . Unknown ( ) ) ,
258
258
globalSetup : Type . Union ( [ Type . String ( ) , Type . Null ( ) ] ) ,
259
259
globalTeardown : Type . Union ( [ Type . String ( ) , Type . Null ( ) ] ) ,
260
- haste : RawHasteConfig ,
260
+ haste : HasteConfig ,
261
261
id : Type . String ( ) ,
262
262
injectGlobals : Type . Boolean ( ) ,
263
263
reporters : Type . Array (
@@ -317,7 +317,7 @@ export const RawInitialOptions = Type.Partial(
317
317
slowTestThreshold : Type . Number ( ) ,
318
318
snapshotResolver : Type . String ( ) ,
319
319
snapshotSerializers : Type . Array ( Type . String ( ) ) ,
320
- snapshotFormat : RawSnapshotFormat ,
320
+ snapshotFormat : SnapshotFormat ,
321
321
errorOnDeprecated : Type . Boolean ( ) ,
322
322
testEnvironment : Type . String ( ) ,
323
323
testEnvironmentOptions : Type . Record ( Type . String ( ) , Type . Unknown ( ) ) ,
0 commit comments