11var test = require ( "tape" )
22
3+ var assign = require ( "object-assign" )
34var path = require ( "path" )
45var fs = require ( "fs" )
56
@@ -16,9 +17,8 @@ function read(name) {
1617}
1718
1819function compareFixtures ( t , name , msg , opts , postcssOpts ) {
19- opts = opts || { path : importsDir }
20- postcss ( )
21- . use ( atImport ( opts ) )
20+ opts = assign ( { path : importsDir } , opts || { } )
21+ postcss ( atImport ( opts ) )
2222 . process ( read ( "fixtures/" + name ) , postcssOpts )
2323 . then ( trimResultCss )
2424 . then ( function ( actual ) {
@@ -42,28 +42,33 @@ test("@import", function(t) {
4242
4343 compareFixtures ( t , "glob" , "should handle a glob pattern" , {
4444 root : __dirname ,
45- path : importsDir ,
4645 glob : true ,
4746 } )
4847
4948 compareFixtures (
5049 t ,
5150 "glob-alt" ,
5251 "should handle a glob pattern with single quote and/or url(...)" , {
53- path : importsDir ,
54- glob : true ,
55- } )
52+ glob : true ,
53+ } )
54+
5655 compareFixtures ( t , "recursive" , "should import stylsheets recursively" )
5756
5857 compareFixtures ( t , "relative" , "should import stylsheets relatively" )
5958
6059 compareFixtures ( t , "empty-and-useless" , "should work with empty files" )
6160
6261 compareFixtures ( t , "transform" , "should support transform" , {
63- path : importsDir ,
6462 transform : require ( "css-whitespace" ) ,
6563 } )
6664
65+ compareFixtures ( t , "plugins" , "should support plugins" , {
66+ plugins : [
67+ require ( "postcss-nested" ) ,
68+ require ( "postcss-bem-linter" ) ,
69+ ] ,
70+ } )
71+
6772 compareFixtures ( t , "cwd" , "should work without a specified path" , { } )
6873
6974 compareFixtures (
@@ -78,7 +83,7 @@ test("@import", function(t) {
7883 t ,
7984 "modules" ,
8085 "should be able to consume npm package or local modules" ,
81- { root : __dirname , path : importsDir }
86+ { root : __dirname }
8287 )
8388
8489 var base = "@import url(http://)"
0 commit comments