@@ -58,17 +58,17 @@ test('Transform html from two file', async t => {
58
58
t . plan ( 2 ) ;
59
59
const folder = await tempfile ( ) ;
60
60
await execa ( cli , [ 'test/fixtures/input.html' , 'test/fixtures/input-indent.html' , '-o' , folder ] ) ;
61
- t . is ( ( await read ( 'test/expected/output-config-pkg.html' ) ) , ( await read ( `${ folder } /test/fixtures/ input.html` ) ) ) ;
62
- t . is ( ( await read ( 'test/expected/output-indent.html' ) ) , ( await read ( `${ folder } /test/fixtures/ input-indent.html` ) ) ) ;
61
+ t . is ( ( await read ( 'test/expected/output-config-pkg.html' ) ) , ( await read ( `${ folder } /input.html` ) ) ) ;
62
+ t . is ( ( await read ( 'test/expected/output-indent.html' ) ) , ( await read ( `${ folder } /input-indent.html` ) ) ) ;
63
63
} ) ;
64
64
65
65
test ( 'Transform html witch options replace' , async t => {
66
66
t . plan ( 2 ) ;
67
67
const folder = await tempfile ( ) ;
68
- await copy ( [ 'test/fixtures/input.html' , 'test/fixtures/input-indent.html' ] , folder , { parents : true } ) ;
69
- await execa ( cli , [ `${ folder } /test/fixtures/ input.html` , `${ folder } /test/fixtures /input-indent.html` ] ) ;
70
- t . is ( ( await read ( 'test/expected/output-config-pkg.html' ) ) , ( await read ( `${ folder } /test/fixtures/ input.html` ) ) ) ;
71
- t . is ( ( await read ( 'test/expected/output-indent.html' ) ) , ( await read ( `${ folder } /test/fixtures/ input-indent.html` ) ) ) ;
68
+ await copy ( [ 'test/fixtures/input.html' , 'test/fixtures/input-indent.html' ] , folder ) ;
69
+ await execa ( cli , [ `${ folder } /input.html` , `${ folder } /input-indent.html` ] ) ;
70
+ t . is ( ( await read ( 'test/expected/output-config-pkg.html' ) ) , ( await read ( `${ folder } /input.html` ) ) ) ;
71
+ t . is ( ( await read ( 'test/expected/output-indent.html' ) ) , ( await read ( `${ folder } /input-indent.html` ) ) ) ;
72
72
} ) ;
73
73
74
74
test ( 'Transform html witch config in file and stdin options use' , async t => {
@@ -144,3 +144,47 @@ test('Transform html stdin options use witch modules', async t => {
144
144
t . true ( await pathExists ( filename ) ) ;
145
145
t . is ( ( await read ( 'test/expected/output-modules.html' ) ) , ( await read ( filename ) ) ) ;
146
146
} ) ;
147
+
148
+ test ( 'Transform html stdin options only config one-io' , async t => {
149
+ t . plan ( 2 ) ;
150
+ await execa ( cli , [
151
+ '-c' ,
152
+ 'test/fixtures/by-config/one-io/config.json'
153
+ ] ) ;
154
+ t . true ( await pathExists ( 'test/expected/by-config/one-io/output.html' ) ) ;
155
+ t . is (
156
+ ( await read ( 'test/expected/by-config/one-io/output.html' ) ) ,
157
+ ( await read ( 'test/fixtures/by-config/one-io/input.html' ) )
158
+ ) ;
159
+ } ) ;
160
+
161
+ test ( 'Transform html stdin options only config two-io to dir' , async t => {
162
+ t . plan ( 4 ) ;
163
+ await execa ( cli , [
164
+ '-c' ,
165
+ 'test/fixtures/by-config/two-io/config.json'
166
+ ] ) ;
167
+ t . true ( await pathExists ( 'test/expected/by-config/two-io/input-1.html' ) ) ;
168
+ t . true ( await pathExists ( 'test/expected/by-config/two-io/input-2.html' ) ) ;
169
+ t . is (
170
+ ( await read ( 'test/expected/by-config/two-io/input-1.html' ) ) ,
171
+ ( await read ( 'test/fixtures/by-config/two-io/input-1.html' ) )
172
+ ) ;
173
+ t . is (
174
+ ( await read ( 'test/expected/by-config/two-io/input-2.html' ) ) ,
175
+ ( await read ( 'test/fixtures/by-config/two-io/input-2.html' ) )
176
+ ) ;
177
+ } ) ;
178
+
179
+ test ( 'Transform html stdin options only config one-io-by-pattern' , async t => {
180
+ t . plan ( 2 ) ;
181
+ await execa ( cli , [
182
+ '-c' ,
183
+ 'test/fixtures/by-config/one-io-by-pattern/config.json'
184
+ ] ) ;
185
+ t . true ( await pathExists ( 'test/expected/by-config/one-io-by-pattern/input-1.html' ) ) ;
186
+ t . is (
187
+ ( await read ( 'test/expected/by-config/one-io-by-pattern/input-1.html' ) ) ,
188
+ ( await read ( 'test/fixtures/by-config/one-io-by-pattern/input-1.html' ) )
189
+ ) ;
190
+ } ) ;
0 commit comments