@@ -82,9 +82,9 @@ describe("CLI", () => {
8282 test . skipIf ( ci ?. skipIf ) (
8383 testName ,
8484 async ( ) => {
85- const { stdout } = await execa ( cmd , given , { cwd } ) ;
85+ const { stdout } = await execa ( cmd , given , { cwd, stripFinalNewline : false } ) ;
8686 if ( want instanceof URL ) {
87- expect ( stdout ) . toMatchFileSnapshot ( fileURLToPath ( want ) ) ;
87+ await expect ( stdout ) . toMatchFileSnapshot ( fileURLToPath ( want ) ) ;
8888 } else {
8989 expect ( stdout ) . toBe ( `${ want } \n` ) ;
9090 }
@@ -97,8 +97,8 @@ describe("CLI", () => {
9797 "stdin" ,
9898 async ( ) => {
9999 const input = fs . readFileSync ( new URL ( "./examples/stripe-api.yaml" , root ) ) ;
100- const { stdout } = await execa ( cmd , { input, cwd } ) ;
101- expect ( stdout ) . toMatchFileSnapshot ( fileURLToPath ( new URL ( "./examples/stripe-api.ts" , root ) ) ) ;
100+ const { stdout } = await execa ( cmd , { input, cwd, stripFinalNewline : false } ) ;
101+ await expect ( stdout ) . toMatchFileSnapshot ( fileURLToPath ( new URL ( "./examples/stripe-api.ts" , root ) ) ) ;
102102 } ,
103103 TIMEOUT ,
104104 ) ;
@@ -119,8 +119,9 @@ describe("CLI", () => {
119119 async ( ) => {
120120 const { stdout } = await execa ( cmd , [ "--properties-required-by-default=true" , "./examples/github-api.yaml" ] , {
121121 cwd,
122+ stripFinalNewline : false ,
122123 } ) ;
123- expect ( stdout ) . toMatchFileSnapshot ( fileURLToPath ( new URL ( "./examples/github-api-required.ts" , root ) ) ) ;
124+ await expect ( stdout ) . toMatchFileSnapshot ( fileURLToPath ( new URL ( "./examples/github-api-required.ts" , root ) ) ) ;
124125 } ,
125126 TIMEOUT ,
126127 ) ;
@@ -134,7 +135,7 @@ describe("CLI", () => {
134135 cwd : fileURLToPath ( cwd ) ,
135136 } ) ;
136137 for ( const schema of [ "a" , "b" , "c" ] ) {
137- expect ( fs . readFileSync ( new URL ( `./output/${ schema } .ts` , cwd ) , "utf8" ) ) . toMatchFileSnapshot (
138+ await expect ( fs . readFileSync ( new URL ( `./output/${ schema } .ts` , cwd ) , "utf8" ) ) . toMatchFileSnapshot (
138139 fileURLToPath ( new URL ( "../../../examples/simple-example.ts" , cwd ) ) ,
139140 ) ;
140141 }
@@ -145,7 +146,7 @@ describe("CLI", () => {
145146 cwd,
146147 } ) ;
147148 for ( const schema of [ "a" , "b" , "c" ] ) {
148- expect (
149+ await expect (
149150 fs . readFileSync ( new URL ( `./test/fixtures/redocly-flag/output/${ schema } .ts` , root ) , "utf8" ) ,
150151 ) . toMatchFileSnapshot ( fileURLToPath ( new URL ( "./examples/simple-example.ts" , root ) ) ) ;
151152 }
0 commit comments