@@ -115,14 +115,33 @@ describe("CLI", () => {
115115 } ) ;
116116
117117 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" ] , {
120139 cwd,
121140 } ) ;
122141 for ( const schema of [ "a" , "b" , "c" ] ) {
123142 expect (
124143 fs . readFileSync (
125- new URL ( `./test/fixtures/redocly/output/${ schema } .ts` , root ) ,
144+ new URL ( `./test/fixtures/redocly-flag /output/${ schema } .ts` , root ) ,
126145 "utf8" ,
127146 ) ,
128147 ) . toMatchFileSnapshot (
0 commit comments