@@ -201,3 +201,43 @@ test('Transform html stdin options only config one-io anf plugins array', async
201201 ( await read ( 'test/fixtures/by-config/one-io-and-plugins-array/input.html' ) )
202202 ) ;
203203} ) ;
204+
205+ test ( 'Output with keeping the folder structure with allInOutput option' , async t => {
206+ t . plan ( 3 ) ;
207+ await execa ( cli , [
208+ 'test/fixtures/input-nesting/**/*.html' ,
209+ '-o' ,
210+ 'test/expected/output-nesting' ,
211+ '-a'
212+ ] ) ;
213+ t . true ( await pathExists ( 'test/expected/output-nesting' ) ) ;
214+ t . is (
215+ ( await read ( 'test/fixtures/input-nesting/input-nesting.html' ) ) ,
216+ ( await read ( 'test/expected/output-nesting/test/fixtures/input-nesting/input-nesting.html' ) )
217+ ) ;
218+ t . is (
219+ ( await read ( 'test/fixtures/input-nesting/input-nesting-child/input-nesting.html' ) ) ,
220+ ( await read ( 'test/expected/output-nesting/test/fixtures/input-nesting/input-nesting-child/input-nesting.html' ) )
221+ ) ;
222+ } ) ;
223+
224+ test ( 'Specify the root of the output folder structure with root option' , async t => {
225+ t . plan ( 3 ) ;
226+ await execa ( cli , [
227+ 'test/fixtures/input-nesting/**/*.html' ,
228+ '-o' ,
229+ 'test/expected/output-nesting-root' ,
230+ '-a' ,
231+ '-r' ,
232+ 'test/fixtures/input-nesting'
233+ ] ) ;
234+ t . true ( await pathExists ( 'test/expected/output-nesting-root' ) ) ;
235+ t . is (
236+ ( await read ( 'test/fixtures/input-nesting/input-nesting.html' ) ) ,
237+ ( await read ( 'test/expected/output-nesting-root/input-nesting.html' ) )
238+ ) ;
239+ t . is (
240+ ( await read ( 'test/fixtures/input-nesting/input-nesting-child/input-nesting.html' ) ) ,
241+ ( await read ( 'test/expected/output-nesting-root/input-nesting-child/input-nesting.html' ) )
242+ ) ;
243+ } ) ;
0 commit comments