@@ -27,7 +27,7 @@ var transformMap = require('../lib/transform-map');
27
27
28
28
29
29
30
-
30
+ // We use 'algorithm': 'top-down' because it easier to have a consistent packing so the expected doesn't have to be updated
31
31
describe ( 'gulp-css-spriter' , function ( ) {
32
32
it ( 'should emit a buffer' , function ( ) {
33
33
var spriterPromise = spriterTest ( { } ) . then ( function ( result ) {
@@ -38,28 +38,46 @@ describe('gulp-css-spriter', function() {
38
38
} ) ;
39
39
40
40
it ( 'should work with minified css' , function ( ) {
41
- return compareSpriterResultsToExpected ( 'test/test-css/background.min.css' , 'test/test-css/expected/background.min.css' ) ;
41
+ return compareSpriterResultsToExpected ( 'test/test-css/background.min.css' , 'test/test-css/expected/background.min.css' , {
42
+ 'spritesmithOptions' : {
43
+ 'algorithm' : 'top-down'
44
+ }
45
+ } ) ;
42
46
} ) ;
43
47
44
48
it ( 'should not try to sprite external images' , function ( ) {
45
- return compareSpriterResultsToExpected ( 'test/test-css/external-image.css' , 'test/test-css/expected/external-image.css' ) ;
49
+ return compareSpriterResultsToExpected ( 'test/test-css/external-image.css' , 'test/test-css/expected/external-image.css' , {
50
+ 'spritesmithOptions' : {
51
+ 'algorithm' : 'top-down'
52
+ }
53
+ } ) ;
46
54
} ) ;
47
55
48
56
it ( 'should sprite properly when the same image source is used in multiple declarations. And one of the declarations is excluded via meta data' , function ( ) {
49
- return compareSpriterResultsToExpected ( 'test/test-css/multiple-declarations-same-image.css' , 'test/test-css/expected/multiple-declarations-same-image.css' ) ;
57
+ return compareSpriterResultsToExpected ( 'test/test-css/multiple-declarations-same-image.css' , 'test/test-css/expected/multiple-declarations-same-image.css' , {
58
+ 'spritesmithOptions' : {
59
+ 'algorithm' : 'top-down'
60
+ }
61
+ } ) ;
50
62
} ) ;
51
63
52
64
// All declarations will be included except those with explcit `includeMode` false meta data
53
65
it ( 'should work in implicit mode `options.includeMode`' , function ( ) {
54
66
return compareSpriterResultsToExpected ( 'test/test-css/overall.css' , 'test/test-css/expected/overall-include-implicit.css' , {
55
- 'includeMode' : 'implicit'
67
+ 'includeMode' : 'implicit' ,
68
+ 'spritesmithOptions' : {
69
+ 'algorithm' : 'top-down'
70
+ }
56
71
} ) ;
57
72
} ) ;
58
73
59
74
// Only declarations with explicit `includeMode` true meta data, will be sprited
60
75
it ( 'should work in explicit mode `options.includeMode`' , function ( ) {
61
76
return compareSpriterResultsToExpected ( 'test/test-css/overall.css' , 'test/test-css/expected/overall-include-explicit.css' , {
62
- 'includeMode' : 'explicit'
77
+ 'includeMode' : 'explicit' ,
78
+ 'spritesmithOptions' : {
79
+ 'algorithm' : 'top-down'
80
+ }
63
81
} ) ;
64
82
} ) ;
65
83
@@ -206,6 +224,7 @@ describe('gulp-css-spriter', function() {
206
224
options = options || { } ;
207
225
208
226
var spriterPromise = spriterTest ( options , actualPath ) . then ( function ( result ) {
227
+ console . log ( String ( result . contents ) ) ;
209
228
return String ( result . contents ) ;
210
229
} ) ;
211
230
0 commit comments