@@ -16,21 +16,21 @@ describe('cli', () => {
1616
1717 describe ( 'init' , ( ) => {
1818 it ( 'creates a Tailwind config file' , ( ) => {
19- cli ( [ 'init' ] ) . then ( ( ) => {
19+ return cli ( [ 'init' ] ) . then ( ( ) => {
2020 expect ( utils . writeFile . mock . calls [ 0 ] [ 0 ] ) . toEqual ( constants . defaultConfigFile )
2121 expect ( utils . writeFile . mock . calls [ 0 ] [ 1 ] ) . toContain ( 'defaultConfig' )
2222 } )
2323 } )
2424
2525 it ( 'creates a Tailwind config file in a custom location' , ( ) => {
26- cli ( [ 'init' , 'custom.js' ] ) . then ( ( ) => {
26+ return cli ( [ 'init' , 'custom.js' ] ) . then ( ( ) => {
2727 expect ( utils . writeFile . mock . calls [ 0 ] [ 0 ] ) . toEqual ( 'custom.js' )
2828 expect ( utils . writeFile . mock . calls [ 0 ] [ 1 ] ) . toContain ( 'defaultConfig' )
2929 } )
3030 } )
3131
3232 it ( 'creates a Tailwind config file without comments' , ( ) => {
33- cli ( [ 'init' , '--no-comments' ] ) . then ( ( ) => {
33+ return cli ( [ 'init' , '--no-comments' ] ) . then ( ( ) => {
3434 expect ( utils . writeFile . mock . calls [ 0 ] [ 1 ] ) . not . toContain ( '/**' )
3535 expect ( utils . writeFile . mock . calls [ 0 ] [ 1 ] ) . toContain ( '//' )
3636 } )
@@ -39,32 +39,32 @@ describe('cli', () => {
3939
4040 describe ( 'build' , ( ) => {
4141 it ( 'compiles CSS file' , ( ) => {
42- cli ( [ 'build' , inputCssPath ] ) . then ( ( ) => {
42+ return cli ( [ 'build' , inputCssPath ] ) . then ( ( ) => {
4343 expect ( process . stdout . write . mock . calls [ 0 ] [ 0 ] ) . toContain ( '.example' )
4444 } )
4545 } )
4646
4747 it ( 'compiles CSS file using custom configuration' , ( ) => {
48- cli ( [ 'build' , inputCssPath , '--config' , customConfigPath ] ) . then ( ( ) => {
48+ return cli ( [ 'build' , inputCssPath , '--config' , customConfigPath ] ) . then ( ( ) => {
4949 expect ( process . stdout . write . mock . calls [ 0 ] [ 0 ] ) . toContain ( '400px' )
5050 } )
5151 } )
5252
5353 it ( 'creates compiled CSS file' , ( ) => {
54- cli ( [ 'build' , inputCssPath , '--output' , 'output.css' ] ) . then ( ( ) => {
54+ return cli ( [ 'build' , inputCssPath , '--output' , 'output.css' ] ) . then ( ( ) => {
5555 expect ( utils . writeFile . mock . calls [ 0 ] [ 0 ] ) . toEqual ( 'output.css' )
5656 expect ( utils . writeFile . mock . calls [ 0 ] [ 1 ] ) . toContain ( '.example' )
5757 } )
5858 } )
5959
6060 it ( 'compiles CSS file with autoprefixer' , ( ) => {
61- cli ( [ 'build' , inputCssPath ] ) . then ( ( ) => {
61+ return cli ( [ 'build' , inputCssPath ] ) . then ( ( ) => {
6262 expect ( process . stdout . write . mock . calls [ 0 ] [ 0 ] ) . toContain ( '-ms-input-placeholder' )
6363 } )
6464 } )
6565
6666 it ( 'compiles CSS file without autoprefixer' , ( ) => {
67- cli ( [ 'build' , inputCssPath , '--no-autoprefixer' ] ) . then ( ( ) => {
67+ return cli ( [ 'build' , inputCssPath , '--no-autoprefixer' ] ) . then ( ( ) => {
6868 expect ( process . stdout . write . mock . calls [ 0 ] [ 0 ] ) . not . toContain ( '-ms-input-placeholder' )
6969 } )
7070 } )
0 commit comments