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