@@ -4,12 +4,11 @@ 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'
78
89describe ( 'cli' , ( ) => {
910 const inputCssPath = path . resolve ( __dirname , 'fixtures/tailwind-input.css' )
1011 const customConfigPath = path . resolve ( __dirname , 'fixtures/custom-config.js' )
11- const defaultConfigFixture = utils . readFile ( constants . defaultConfigStubFile )
12- const simpleConfigFixture = utils . readFile ( constants . simpleConfigStubFile )
1312 const defaultPostCssConfigFixture = utils . readFile ( constants . defaultPostCssConfigStubFile )
1413
1514 beforeEach ( ( ) => {
@@ -21,15 +20,15 @@ describe('cli', () => {
2120 it ( 'creates a Tailwind config file' , ( ) => {
2221 return runInTempDirectory ( ( ) => {
2322 return cli ( [ 'init' ] ) . then ( ( ) => {
24- expect ( utils . readFile ( constants . defaultConfigFile ) ) . toEqual ( simpleConfigFixture )
23+ expect ( utils . exists ( constants . defaultConfigFile ) ) . toEqual ( true )
2524 } )
2625 } )
2726 } )
2827
2928 it ( 'creates a Tailwind config file and a postcss.config.js file' , ( ) => {
3029 return runInTempDirectory ( ( ) => {
3130 return cli ( [ 'init' , '-p' ] ) . then ( ( ) => {
32- expect ( utils . readFile ( constants . defaultConfigFile ) ) . toEqual ( simpleConfigFixture )
31+ expect ( utils . exists ( constants . defaultConfigFile ) ) . toEqual ( true )
3332 expect ( utils . readFile ( constants . defaultPostCssConfigFile ) ) . toEqual (
3433 defaultPostCssConfigFixture
3534 )
@@ -40,7 +39,7 @@ describe('cli', () => {
4039 it ( 'creates a full Tailwind config file' , ( ) => {
4140 return runInTempDirectory ( ( ) => {
4241 return cli ( [ 'init' , '--full' ] ) . then ( ( ) => {
43- expect ( utils . readFile ( constants . defaultConfigFile ) ) . toEqual ( defaultConfigFixture )
42+ expect ( utils . exists ( constants . defaultConfigFile ) ) . toEqual ( true )
4443 } )
4544 } )
4645 } )
@@ -94,5 +93,15 @@ describe('cli', () => {
9493 expect ( process . stdout . write . mock . calls [ 0 ] [ 0 ] ) . not . toContain ( '-ms-input-placeholder' )
9594 } )
9695 } )
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+ } )
97106 } )
98107} )
0 commit comments