@@ -4,11 +4,12 @@ import cli from '../src/cli/main'
44import * as constants from '../src/constants'
55import * as utils from '../src/cli/utils'
66import runInTempDirectory from '../jest/runInTempDirectory'
7- import featureFlags from '../src/featureFlags'
87
98describe ( 'cli' , ( ) => {
109 const inputCssPath = path . resolve ( __dirname , 'fixtures/tailwind-input.css' )
1110 const customConfigPath = path . resolve ( __dirname , 'fixtures/custom-config.js' )
11+ const defaultConfigFixture = utils . readFile ( constants . defaultConfigStubFile )
12+ const simpleConfigFixture = utils . readFile ( constants . simpleConfigStubFile )
1213 const defaultPostCssConfigFixture = utils . readFile ( constants . defaultPostCssConfigStubFile )
1314
1415 beforeEach ( ( ) => {
@@ -20,15 +21,15 @@ describe('cli', () => {
2021 it ( 'creates a Tailwind config file' , ( ) => {
2122 return runInTempDirectory ( ( ) => {
2223 return cli ( [ 'init' ] ) . then ( ( ) => {
23- expect ( utils . exists ( constants . defaultConfigFile ) ) . toEqual ( true )
24+ expect ( utils . readFile ( constants . defaultConfigFile ) ) . toEqual ( simpleConfigFixture )
2425 } )
2526 } )
2627 } )
2728
2829 it ( 'creates a Tailwind config file and a postcss.config.js file' , ( ) => {
2930 return runInTempDirectory ( ( ) => {
3031 return cli ( [ 'init' , '-p' ] ) . then ( ( ) => {
31- expect ( utils . exists ( constants . defaultConfigFile ) ) . toEqual ( true )
32+ expect ( utils . readFile ( constants . defaultConfigFile ) ) . toEqual ( simpleConfigFixture )
3233 expect ( utils . readFile ( constants . defaultPostCssConfigFile ) ) . toEqual (
3334 defaultPostCssConfigFixture
3435 )
@@ -39,7 +40,7 @@ describe('cli', () => {
3940 it ( 'creates a full Tailwind config file' , ( ) => {
4041 return runInTempDirectory ( ( ) => {
4142 return cli ( [ 'init' , '--full' ] ) . then ( ( ) => {
42- expect ( utils . exists ( constants . defaultConfigFile ) ) . toEqual ( true )
43+ expect ( utils . readFile ( constants . defaultConfigFile ) ) . toEqual ( defaultConfigFixture )
4344 } )
4445 } )
4546 } )
@@ -93,15 +94,5 @@ describe('cli', () => {
9394 expect ( process . stdout . write . mock . calls [ 0 ] [ 0 ] ) . not . toContain ( '-ms-input-placeholder' )
9495 } )
9596 } )
96-
97- it ( 'creates a Tailwind config file with future flags' , ( ) => {
98- return runInTempDirectory ( ( ) => {
99- return cli ( [ 'init' ] ) . then ( ( ) => {
100- featureFlags . future . forEach ( flag => {
101- expect ( utils . readFile ( constants . defaultConfigFile ) ) . toContain ( `${ flag } : true` )
102- } )
103- } )
104- } )
105- } )
10697 } )
10798} )
0 commit comments