@@ -2,13 +2,14 @@ var should = require("should");
2
2
var path = require ( "path" ) ;
3
3
var cssLoader = require ( "../index.js" ) ;
4
4
5
- function test ( name , input , result ) {
5
+ function test ( name , input , result , query ) {
6
6
it ( name , function ( ) {
7
7
var output ;
8
8
cssLoader . call ( {
9
9
loaders : [ { request : "loader" } ] ,
10
10
loaderIndex : 0 ,
11
11
resource : "test.css" ,
12
+ query : query ,
12
13
callback : function ( err , result ) {
13
14
output = result ;
14
15
}
@@ -58,6 +59,10 @@ describe("url", function() {
58
59
[ "\".class { background: green url( \"+require(\"./img.png\")+\" ) xyz }\"" ] ) ;
59
60
test ( "background img 2" , ".class { background: green url(~img/png ) url(aaa) xyz }" ,
60
61
[ "\".class { background: green url(\"+require(\"img/png\")+\" ) url(\"+require(\"./aaa\")+\") xyz }\"" ] ) ;
62
+ test ( "background img absolute" , ".class { background: green url(/img.png) xyz }" ,
63
+ [ "\".class { background: green url(/img.png) xyz }\"" ] ) ;
64
+ test ( "background img absolute with root" , ".class { background: green url(/img.png) xyz }" ,
65
+ [ "\".class { background: green url(\"+require(\"./img.png\")+\") xyz }\"" ] , "?root=." ) ;
61
66
test ( "background img external" ,
62
67
".class { background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz }" ,
63
68
[ "\".class { background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz }\"" ] ) ;
0 commit comments