@@ -115,14 +115,33 @@ describe("CLI", () => {
115
115
} ) ;
116
116
117
117
describe ( "Redocly config" , ( ) => {
118
- test ( "accepts multiple APIs" , async ( ) => {
119
- await execa ( cmd , [ "--redoc" , "test/fixtures/redocly/redocly.yaml" ] , {
118
+ // TODO: why won’t this run on Windows?
119
+ test . skipIf ( os . platform ( ) === "win32" ) ( "automatic config" , async ( ) => {
120
+ /* eslint-disable @typescript-eslint/no-shadow */
121
+
122
+ // note: we have to change the cwd here for the automatic config to pick up properly
123
+ const root = new URL ( "./fixtures/redocly/" , import . meta. url ) ;
124
+ const cwd = os . platform ( ) === "win32" ? fileURLToPath ( root ) : root ;
125
+
126
+ await execa ( "../../../bin/cli.js" , { cwd } ) ;
127
+ for ( const schema of [ "a" , "b" , "c" ] ) {
128
+ expect (
129
+ fs . readFileSync ( new URL ( `./output/${ schema } .ts` , root ) , "utf8" ) ,
130
+ ) . toMatchFileSnapshot (
131
+ fileURLToPath ( new URL ( "../../../examples/simple-example.ts" , root ) ) ,
132
+ ) ;
133
+ }
134
+ /* eslint-enable @typescript-eslint/no-shadow */
135
+ } ) ;
136
+
137
+ test ( "--redoc config" , async ( ) => {
138
+ await execa ( cmd , [ "--redoc" , "test/fixtures/redocly-flag/redocly.yaml" ] , {
120
139
cwd,
121
140
} ) ;
122
141
for ( const schema of [ "a" , "b" , "c" ] ) {
123
142
expect (
124
143
fs . readFileSync (
125
- new URL ( `./test/fixtures/redocly/output/${ schema } .ts` , root ) ,
144
+ new URL ( `./test/fixtures/redocly-flag /output/${ schema } .ts` , root ) ,
126
145
"utf8" ,
127
146
) ,
128
147
) . toMatchFileSnapshot (
0 commit comments