99
1010import { type Static , Type } from '@sinclair/typebox' ;
1111
12- export const RawSnapshotFormat = Type . Partial (
12+ export const SnapshotFormat = Type . Partial (
1313 Type . Object ( {
1414 callToJSON : Type . Boolean ( ) ,
1515 compareKeys : Type . Null ( ) ,
@@ -34,12 +34,12 @@ export const RawSnapshotFormat = Type.Partial(
3434 } ) ,
3535) ;
3636
37- const RawCoverageProvider = Type . Union ( [
37+ const CoverageProvider = Type . Union ( [
3838 Type . Literal ( 'babel' ) ,
3939 Type . Literal ( 'v8' ) ,
4040] ) ;
4141
42- const RawCoverageThresholdValue = Type . Partial (
42+ const CoverageThresholdValue = Type . Partial (
4343 Type . Object ( {
4444 branches : Type . Number ( { minimum : 0 , maximum : 100 } ) ,
4545 functions : Type . Number ( { minimum : 0 , maximum : 100 } ) ,
@@ -48,15 +48,15 @@ const RawCoverageThresholdValue = Type.Partial(
4848 } ) ,
4949) ;
5050
51- const RawCoverageThresholdBase = Type . Object (
52- { global : RawCoverageThresholdValue } ,
53- { additionalProperties : RawCoverageThresholdValue } ,
51+ const CoverageThresholdBase = Type . Object (
52+ { global : CoverageThresholdValue } ,
53+ { additionalProperties : CoverageThresholdValue } ,
5454) ;
5555
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 ) ;
6060
6161// TODO: add type test that these are all the colors available in chalk.ForegroundColor
6262export const ChalkForegroundColors = Type . Union ( [
@@ -80,13 +80,13 @@ export const ChalkForegroundColors = Type.Union([
8080 Type . Literal ( 'whiteBright' ) ,
8181] ) ;
8282
83- const RawDisplayName = Type . Object ( {
83+ const DisplayName = Type . Object ( {
8484 name : Type . String ( ) ,
8585 color : ChalkForegroundColors ,
8686} ) ;
8787
8888// TODO: verify these are the names of istanbulReport.ReportOptions
89- export const RawCoverageReporterNames = Type . Union ( [
89+ export const CoverageReporterNames = Type . Union ( [
9090 Type . Literal ( 'clover' ) ,
9191 Type . Literal ( 'cobertura' ) ,
9292 Type . Literal ( 'html-spa' ) ,
@@ -102,17 +102,17 @@ export const RawCoverageReporterNames = Type.Union([
102102 Type . Literal ( 'text-summary' ) ,
103103] ) ;
104104
105- const RawCoverageReporters = Type . Array (
105+ const CoverageReporters = Type . Array (
106106 Type . Union ( [
107- RawCoverageReporterNames ,
107+ CoverageReporterNames ,
108108 Type . Tuple ( [
109- RawCoverageReporterNames ,
109+ CoverageReporterNames ,
110110 Type . Record ( Type . String ( ) , Type . Unknown ( ) ) ,
111111 ] ) ,
112112 ] ) ,
113113) ;
114114
115- const RawGlobalFakeTimersConfig = Type . Partial (
115+ const GlobalFakeTimersConfig = Type . Partial (
116116 Type . Object ( {
117117 enableGlobally : Type . Boolean ( {
118118 description :
@@ -122,7 +122,7 @@ const RawGlobalFakeTimersConfig = Type.Partial(
122122 } ) ,
123123) ;
124124
125- const RawFakeableAPI = Type . Union ( [
125+ const FakeableAPI = Type . Union ( [
126126 Type . Literal ( 'Date' ) ,
127127 Type . Literal ( 'hrtime' ) ,
128128 Type . Literal ( 'nextTick' ) ,
@@ -140,15 +140,15 @@ const RawFakeableAPI = Type.Union([
140140 Type . Literal ( 'clearTimeout' ) ,
141141] ) ;
142142
143- const RawFakeTimersConfig = Type . Partial (
143+ const FakeTimersConfig = Type . Partial (
144144 Type . Object ( {
145145 advanceTimers : Type . Union ( [ Type . Boolean ( ) , Type . Number ( { minimum : 0 } ) ] , {
146146 description :
147147 'If set to `true` all timers will be advanced automatically by 20 milliseconds every 20 milliseconds. A custom ' +
148148 'time delta may be provided by passing a number.' ,
149149 default : false ,
150150 } ) ,
151- doNotFake : Type . Array ( RawFakeableAPI , {
151+ doNotFake : Type . Array ( FakeableAPI , {
152152 description :
153153 'List of names of APIs (e.g. `Date`, `nextTick()`, `setImmediate()`, `setTimeout()`) that should not be faked.' +
154154 '\n\nThe default is `[]`, meaning all APIs are faked.' ,
@@ -173,7 +173,7 @@ const RawFakeTimersConfig = Type.Partial(
173173 } ) ,
174174) ;
175175
176- const RawLegacyFakeTimersConfig = Type . Partial (
176+ const LegacyFakeTimersConfig = Type . Partial (
177177 Type . Object ( {
178178 legacyFakeTimers : Type . Literal ( true , {
179179 description :
@@ -183,12 +183,12 @@ const RawLegacyFakeTimersConfig = Type.Partial(
183183 } ) ,
184184) ;
185185
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 ] ) ,
189189] ) ;
190190
191- const RawHasteConfig = Type . Partial (
191+ const HasteConfig = Type . Partial (
192192 Type . Object ( {
193193 computeSha1 : Type . Boolean ( {
194194 description : 'Whether to hash files using SHA-1.' ,
@@ -225,7 +225,7 @@ const RawHasteConfig = Type.Partial(
225225 } ) ,
226226) ;
227227
228- export const RawInitialOptions = Type . Partial (
228+ export const InitialOptions = Type . Partial (
229229 Type . Object ( {
230230 automock : Type . Boolean ( ) ,
231231 bail : Type . Union ( [ Type . Boolean ( ) , Type . Number ( ) ] ) ,
@@ -239,16 +239,16 @@ export const RawInitialOptions = Type.Partial(
239239 collectCoverageFrom : Type . Array ( Type . String ( ) ) ,
240240 coverageDirectory : Type . String ( ) ,
241241 coveragePathIgnorePatterns : Type . Array ( Type . String ( ) ) ,
242- coverageProvider : RawCoverageProvider ,
243- coverageReporters : RawCoverageReporters ,
244- coverageThreshold : RawCoverageThreshold ,
242+ coverageProvider : CoverageProvider ,
243+ coverageReporters : CoverageReporters ,
244+ coverageThreshold : CoverageThreshold ,
245245 dependencyExtractor : Type . String ( ) ,
246246 detectLeaks : Type . Boolean ( ) ,
247247 detectOpenHandles : Type . Boolean ( ) ,
248- displayName : Type . Union ( [ Type . String ( ) , RawDisplayName ] ) ,
248+ displayName : Type . Union ( [ Type . String ( ) , DisplayName ] ) ,
249249 expand : Type . Boolean ( ) ,
250250 extensionsToTreatAsEsm : Type . Array ( Type . String ( ) ) ,
251- fakeTimers : RawFakeTimers ,
251+ fakeTimers : FakeTimers ,
252252 filter : Type . String ( ) ,
253253 findRelatedTests : Type . Boolean ( ) ,
254254 forceCoverageMatch : Type . Array ( Type . String ( ) ) ,
@@ -257,7 +257,7 @@ export const RawInitialOptions = Type.Partial(
257257 globals : Type . Record ( Type . String ( ) , Type . Unknown ( ) ) ,
258258 globalSetup : Type . Union ( [ Type . String ( ) , Type . Null ( ) ] ) ,
259259 globalTeardown : Type . Union ( [ Type . String ( ) , Type . Null ( ) ] ) ,
260- haste : RawHasteConfig ,
260+ haste : HasteConfig ,
261261 id : Type . String ( ) ,
262262 injectGlobals : Type . Boolean ( ) ,
263263 reporters : Type . Array (
@@ -317,7 +317,7 @@ export const RawInitialOptions = Type.Partial(
317317 slowTestThreshold : Type . Number ( ) ,
318318 snapshotResolver : Type . String ( ) ,
319319 snapshotSerializers : Type . Array ( Type . String ( ) ) ,
320- snapshotFormat : RawSnapshotFormat ,
320+ snapshotFormat : SnapshotFormat ,
321321 errorOnDeprecated : Type . Boolean ( ) ,
322322 testEnvironment : Type . String ( ) ,
323323 testEnvironmentOptions : Type . Record ( Type . String ( ) , Type . Unknown ( ) ) ,
0 commit comments