@@ -8,9 +8,9 @@ import copy from 'cpy';
88import tempfile from 'tempfile' ;
99
1010const cli = path . resolve ( 'lib/cli.js' ) ;
11- const read = file => new Promise ( ( resolve , reject ) => fs . readFile ( file , 'utf8' , ( err , data ) => {
12- if ( err ) {
13- return reject ( err ) ;
11+ const read = file => new Promise ( ( resolve , reject ) => fs . readFile ( file , 'utf8' , ( error , data ) => {
12+ if ( error ) {
13+ return reject ( error ) ;
1414 }
1515
1616 resolve ( data ) ;
@@ -85,8 +85,7 @@ test('Transform html witch config in file and stdin options use', async t => {
8585 '--posthtml-bem.elemPrefix=--' ,
8686 '--posthtml-bem.modPrefix' ,
8787 '_' ,
88- '--posthtml-bem.modDlmtr' ,
89- '--'
88+ '--posthtml-bem.modDlmtr'
9089 ] ) ;
9190 t . true ( await pathExists ( filename ) ) ;
9291 t . is ( ( await read ( 'test/expected/output-bem.html' ) ) , ( await read ( filename ) ) ) ;
@@ -108,6 +107,28 @@ test('Transform html witch stdin options use', async t => {
108107 t . is ( ( await read ( 'test/expected/output-custom-elements.html' ) ) , ( await read ( filename ) ) ) ;
109108} ) ;
110109
110+ test ( 'Transform html witch stdin options use two key' , async t => {
111+ t . plan ( 2 ) ;
112+ const filename = tempfile ( '.html' ) ;
113+ await execa ( cli , [
114+ 'test/fixtures/input-bem.html' ,
115+ '-o' ,
116+ filename ,
117+ '-u' ,
118+ 'posthtml-bem' ,
119+ '--posthtml-bem.elemPrefix=--' ,
120+ '--posthtml-bem.modPrefix' ,
121+ '_' ,
122+ '--posthtml-bem.modDlmtr' ,
123+ '-u' ,
124+ 'posthtml-custom-elements' ,
125+ '--posthtml-custom-elements.defaultTag' ,
126+ 'span'
127+ ] ) ;
128+ t . true ( await pathExists ( filename ) ) ;
129+ t . is ( ( await read ( 'test/expected/output-bem.html' ) ) , ( await read ( filename ) ) ) ;
130+ } ) ;
131+
111132test ( 'Transform html stdin options use witch modules' , async t => {
112133 t . plan ( 2 ) ;
113134 const filename = tempfile ( '.html' ) ;
0 commit comments