@@ -25,40 +25,40 @@ test("cli", function(t) {
25
25
t . equal ( res , output , "should read from a file and write to a file" )
26
26
utils . remove ( "cli.output--io" )
27
27
} )
28
- planned += 1
28
+ planned += 1
29
29
30
30
exec ( cssnextBin + " test/fixtures/cli.css" , function ( err , stdout ) {
31
31
if ( err ) { throw err }
32
32
t . equal ( stdout , output , "should read from a file and write to stdout" )
33
33
} )
34
- planned += 1
34
+ planned += 1
35
35
36
36
var childProcess = exec ( cssnextBin , function ( err , stdout ) {
37
37
if ( err ) { throw err }
38
38
t . equal ( stdout , output , "should read from stdin and write to stdout" )
39
39
} )
40
40
childProcess . stdin . write ( new Buffer ( input ) )
41
41
childProcess . stdin . end ( )
42
- planned += 1
42
+ planned += 1
43
43
44
44
exec ( cssnextBin + " test/fixtures/cli.dont-exist.css" , function ( err , stdout , stderr ) {
45
45
t . ok ( err && err . code === 1 , "should return an error when input file is unreadable" )
46
46
t . ok ( utils . contains ( stderr , "Unable to read file" ) , "should show that the input file is not found" )
47
47
} )
48
- planned += 2
48
+ planned += 2
49
49
50
50
exec ( cssnextBin + " test/fixtures/cli.error.css" , function ( err , stdout , stderr ) {
51
51
t . ok ( err && err . code === 2 , "should throw an error" )
52
52
t . ok ( utils . contains ( stderr , "encounters an error" ) , "should output a readable error" )
53
53
t . ok ( utils . contains ( stderr , "If this error looks like a bug, please report it here" ) , "should show the url where to report bugs" )
54
54
} )
55
- planned += 3
55
+ planned += 3
56
56
57
57
exec ( cssnextBin + " --config test/fixtures/config.json test/fixtures/config.css" , function ( err , stdout ) {
58
58
if ( err ) { throw err }
59
59
t . equal ( stdout , utils . readFixture ( "config.expected" ) , "should read config file on --config" )
60
60
} )
61
- planned += 1
61
+ planned += 1
62
62
63
63
var noCustomPropInput = ":root{--foo:bar}baz{qux:var(--foo)}"
64
64
var childProcessBrowsers = exec ( cssnextBin + " --browsers \"Firefox >= 31\"" , function ( err , stdout ) {
@@ -67,64 +67,64 @@ test("cli", function(t) {
67
67
} )
68
68
childProcessBrowsers . stdin . write ( new Buffer ( noCustomPropInput ) )
69
69
childProcessBrowsers . stdin . end ( )
70
- planned += 1
70
+ planned += 1
71
71
72
72
exec ( cssnextBin + " --verbose test/fixtures/cli.css test/fixtures/cli.output--verbose.css" , function ( err , stdout ) {
73
73
if ( err ) { throw err }
74
74
t . ok ( utils . contains ( stdout , "Output written" ) , "should log on --verbose" )
75
75
utils . remove ( "cli.output--verbose" )
76
76
} )
77
- planned += 1
77
+ planned += 1
78
78
79
79
exec ( cssnextBin + " --no-import test/fixtures/import.css" , function ( err , stdout ) {
80
80
if ( err ) { throw err }
81
81
t . equal ( stdout , utils . readFixture ( "import" ) , "should not import on --no-import" )
82
82
} )
83
- planned += 1
83
+ planned += 1
84
84
85
85
exec ( cssnextBin + " --no-url test/fixtures/url.css" , { cwd : process . cwd ( ) } , function ( err , stdout ) {
86
86
if ( err ) { throw err }
87
87
t . equal ( stdout , utils . readFixture ( "url/dep" ) , "should not adjust url on --no-url" )
88
88
} )
89
- planned += 1
89
+ planned += 1
90
90
91
91
exec ( cssnextBin + " --compress test/fixtures/compress.css" , function ( err , stdout ) {
92
92
if ( err ) { throw err }
93
93
t . equal ( stdout , utils . readFixture ( "compress.default.expected" ) . trim ( ) , "should compress on --compress" )
94
94
} )
95
- planned += 1
95
+ planned += 1
96
96
97
97
exec ( cssnextBin + " --sourcemap test/fixtures/sourcemap.css" , function ( err , stdout ) {
98
98
if ( err ) { throw err }
99
99
t . equal ( stdout , utils . readFixture ( "sourcemap.expected" ) . trim ( ) , "should add sourcemap on --sourcemap" )
100
100
} )
101
- planned += 1
101
+ planned += 1
102
102
103
103
var toSpace = require ( "to-space-case" )
104
104
var toSlug = require ( "to-slug-case" )
105
105
var features = Object . keys ( cssnext . features )
106
106
var no = "--no-" + features . map ( function ( feature ) { return toSlug ( feature ) } ) . join ( " --no-" )
107
107
features . forEach ( function ( feature ) {
108
108
var slug = toSlug ( feature )
109
- var output = utils . readFixture ( "features/" + slug )
109
+ var featureOutput = utils . readFixture ( "features/" + slug )
110
110
exec ( cssnextBin + " " + no + " test/fixtures/features/" + slug + ".css" , function ( err , stdout ) {
111
111
if ( err ) { throw err }
112
- t . equal ( stdout , output , "should not modify input of '" + toSpace ( feature ) + "' fixture if all features are disabled" )
112
+ t . equal ( stdout , featureOutput , "should not modify input of '" + toSpace ( feature ) + "' fixture if all features are disabled" )
113
113
} )
114
114
} )
115
- planned += features . length
115
+ planned += features . length
116
116
117
117
exec ( cssnextBin + " --watch" , function ( err , stdout , stderr ) {
118
118
t . ok ( err && err . code === 3 , "should return an error when <input> or <output> are missing when `--watch` option passed" )
119
119
t . ok ( utils . contains ( stderr , "--watch option need" ) , "should show an explanation when <input> or <output> are missing when `--watch` option passed" )
120
120
} )
121
- planned += 2
121
+ planned += 2
122
122
123
123
exec ( cssnextBin + " --watch test/fixtures/cli.css" , function ( err , stdout , stderr ) {
124
124
t . ok ( err && err . code === 3 , "should return an error when <output> is missing when `--watch` option passed" )
125
125
t . ok ( utils . contains ( stderr , "--watch option need" ) , "should show an explanation when <output> is missing when `--watch` option passed" )
126
126
} )
127
- planned += 2
127
+ planned += 2
128
128
129
129
t . plan ( planned )
130
130
} )
0 commit comments