@@ -86,51 +86,48 @@ describe("CLI", () => {
86
86
} ) ;
87
87
} ) ;
88
88
89
- describe ( "outputs" , ( ) => {
90
- beforeEach ( ( ) => {
89
+ describe ( "outputs" , ( ) => {
90
+ beforeEach ( ( ) => {
91
91
fs . rmSync ( new URL ( outputDir , root ) , { recursive : true , force : true } ) ;
92
92
} ) ;
93
93
94
- test ( "single file to file" , async ( ) => {
94
+ test ( "single file to file" , async ( ) => {
95
95
const inputFile = path . join ( inputDir , "file-a.yaml" ) ;
96
96
const outputFile = path . join ( outputDir , "file-a.ts" ) ;
97
97
await execa ( cmd , [ inputFile , "--output" , outputFile ] , { cwd } ) ;
98
98
const result = await getOutputFiles ( ) ;
99
- expect ( result ) . toEqual ( [ "file-a.ts" ] ) ;
99
+ expect ( result ) . toEqual ( [ "file-a.ts" ] ) ;
100
100
} ) ;
101
101
102
- test ( "single file to directory" , async ( ) => {
102
+ test ( "single file to directory" , async ( ) => {
103
103
const inputFile = path . join ( inputDir , "file-a.yaml" ) ;
104
104
await execa ( cmd , [ inputFile , "--output" , outputDir ] , { cwd } ) ;
105
105
const result = await getOutputFiles ( ) ;
106
- expect ( result ) . toEqual ( [ "test/fixtures/cli-outputs/file-a.ts" ] ) ;
106
+ expect ( result ) . toEqual ( [ "test/fixtures/cli-outputs/file-a.ts" ] ) ;
107
107
} ) ;
108
108
109
- test ( "single file (glob) to file" , async ( ) => {
109
+ test ( "single file (glob) to file" , async ( ) => {
110
110
const inputFile = path . join ( inputDir , "*-a.yaml" ) ;
111
111
const outputFile = path . join ( outputDir , "file-a.ts" ) ;
112
112
await execa ( cmd , [ inputFile , "--output" , outputFile ] , { cwd } ) ;
113
113
const result = await getOutputFiles ( ) ;
114
- expect ( result ) . toEqual ( [ "file-a.ts" ] ) ;
115
- } )
114
+ expect ( result ) . toEqual ( [ "file-a.ts" ] ) ;
115
+ } ) ;
116
116
117
- test ( "multiple files to file" , async ( ) => {
117
+ test ( "multiple files to file" , async ( ) => {
118
118
const inputFile = path . join ( inputDir , "*.yaml" ) ;
119
119
const outputFile = path . join ( outputDir , "file-a.ts" ) ;
120
120
await expect ( execa ( cmd , [ inputFile , "--output" , outputFile ] , { cwd } ) ) . rejects . toThrow ( ) ;
121
- } )
121
+ } ) ;
122
122
123
- test ( "multiple files to directory" , async ( ) => {
123
+ test ( "multiple files to directory" , async ( ) => {
124
124
const inputFile = path . join ( inputDir , "*.yaml" ) ;
125
125
await execa ( cmd , [ inputFile , "--output" , outputDir ] , { cwd } ) ;
126
126
const result = await getOutputFiles ( ) ;
127
- expect ( result ) . toEqual ( [
128
- "test/fixtures/cli-outputs/file-a.ts" ,
129
- "test/fixtures/cli-outputs/file-b.ts"
130
- ] ) ;
131
- } )
127
+ expect ( result ) . toEqual ( [ "test/fixtures/cli-outputs/file-a.ts" , "test/fixtures/cli-outputs/file-b.ts" ] ) ;
128
+ } ) ;
132
129
133
- test ( "multiple nested files to directory" , async ( ) => {
130
+ test ( "multiple nested files to directory" , async ( ) => {
134
131
const inputFile = path . join ( inputDir , "**/*.yaml" ) ;
135
132
await execa ( cmd , [ inputFile , "--output" , outputDir ] , { cwd } ) ;
136
133
const result = await getOutputFiles ( ) ;
@@ -141,6 +138,6 @@ describe("CLI", () => {
141
138
"test/fixtures/cli-outputs/nested/file-c.ts" ,
142
139
"test/fixtures/cli-outputs/nested/file-d.ts" ,
143
140
] ) ;
144
- } )
141
+ } ) ;
145
142
} ) ;
146
143
} ) ;
0 commit comments