@@ -28,3 +28,30 @@ describe("alias", function() {
28
28
test ( "exactMatch" , css , exports . exactMatch , aliasOptions ( { "./path/to/file.png$" : "module/file.png" } ) ) ;
29
29
test ( "notExactMatch" , css , exports . notExactMatch , aliasOptions ( { "./path/to/file.jpg$" : "module/file.jpg" } ) ) ;
30
30
} ) ;
31
+
32
+ describe ( "alias starting with /" , function ( ) {
33
+ var css = ".className { background: url(/path/to/file.png); }" ;
34
+ var exports = {
35
+ without : [
36
+ [ 1 , ".className { background: url(/path/to/file.png); }" , "" ]
37
+ ] ,
38
+ onlyModule : [
39
+ [ 1 , ".className { background: url({module/file.png}); }" , "" ]
40
+ ] ,
41
+ exactMatch : [
42
+ [ 1 , ".className { background: url({module/file.png}); }" , "" ]
43
+ ] ,
44
+ notExactMatch : [
45
+ [ 1 , ".className { background: url(/path/to/file.png); }" , "" ]
46
+ ]
47
+ } ;
48
+
49
+ function aliasOptions ( alias ) {
50
+ return { query : { alias : alias } }
51
+ }
52
+
53
+ test ( "without" , css , exports . without ) ;
54
+ test ( "onlyModule" , css , exports . onlyModule , aliasOptions ( { "/path/to" : "module" } ) ) ;
55
+ test ( "exactMatch" , css , exports . exactMatch , aliasOptions ( { "/path/to/file.png$" : "module/file.png" } ) ) ;
56
+ test ( "notExactMatch" , css , exports . notExactMatch , aliasOptions ( { "/path/to/file.jpg$" : "module/file.jpg" } ) ) ;
57
+ } ) ;
0 commit comments