@@ -4,12 +4,11 @@ import cli from '../src/cli/main'
4
4
import * as constants from '../src/constants'
5
5
import * as utils from '../src/cli/utils'
6
6
import runInTempDirectory from '../jest/runInTempDirectory'
7
+ import featureFlags from '../src/featureFlags'
7
8
8
9
describe ( 'cli' , ( ) => {
9
10
const inputCssPath = path . resolve ( __dirname , 'fixtures/tailwind-input.css' )
10
11
const customConfigPath = path . resolve ( __dirname , 'fixtures/custom-config.js' )
11
- const defaultConfigFixture = utils . readFile ( constants . defaultConfigStubFile )
12
- const simpleConfigFixture = utils . readFile ( constants . simpleConfigStubFile )
13
12
const defaultPostCssConfigFixture = utils . readFile ( constants . defaultPostCssConfigStubFile )
14
13
15
14
beforeEach ( ( ) => {
@@ -21,15 +20,15 @@ describe('cli', () => {
21
20
it ( 'creates a Tailwind config file' , ( ) => {
22
21
return runInTempDirectory ( ( ) => {
23
22
return cli ( [ 'init' ] ) . then ( ( ) => {
24
- expect ( utils . readFile ( constants . defaultConfigFile ) ) . toEqual ( simpleConfigFixture )
23
+ expect ( utils . exists ( constants . defaultConfigFile ) ) . toEqual ( true )
25
24
} )
26
25
} )
27
26
} )
28
27
29
28
it ( 'creates a Tailwind config file and a postcss.config.js file' , ( ) => {
30
29
return runInTempDirectory ( ( ) => {
31
30
return cli ( [ 'init' , '-p' ] ) . then ( ( ) => {
32
- expect ( utils . readFile ( constants . defaultConfigFile ) ) . toEqual ( simpleConfigFixture )
31
+ expect ( utils . exists ( constants . defaultConfigFile ) ) . toEqual ( true )
33
32
expect ( utils . readFile ( constants . defaultPostCssConfigFile ) ) . toEqual (
34
33
defaultPostCssConfigFixture
35
34
)
@@ -40,7 +39,7 @@ describe('cli', () => {
40
39
it ( 'creates a full Tailwind config file' , ( ) => {
41
40
return runInTempDirectory ( ( ) => {
42
41
return cli ( [ 'init' , '--full' ] ) . then ( ( ) => {
43
- expect ( utils . readFile ( constants . defaultConfigFile ) ) . toEqual ( defaultConfigFixture )
42
+ expect ( utils . exists ( constants . defaultConfigFile ) ) . toEqual ( true )
44
43
} )
45
44
} )
46
45
} )
@@ -94,5 +93,15 @@ describe('cli', () => {
94
93
expect ( process . stdout . write . mock . calls [ 0 ] [ 0 ] ) . not . toContain ( '-ms-input-placeholder' )
95
94
} )
96
95
} )
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
+ } )
97
106
} )
98
107
} )
0 commit comments