|
3 | 3 | var test = require("./helpers").test;
|
4 | 4 |
|
5 | 5 | describe("alias", function() {
|
6 |
| - var css = ".className { background: url(./path/to/file.png); }"; |
7 |
| - var exports = { |
8 |
| - without: [ |
9 |
| - [1, ".className { background: url({./path/to/file.png}); }", ""] |
10 |
| - ], |
11 |
| - onlyModule: [ |
12 |
| - [1, ".className { background: url({module/file.png}); }", ""] |
13 |
| - ], |
14 |
| - exactMatch: [ |
15 |
| - [1, ".className { background: url({module/file.png}); }", ""] |
16 |
| - ], |
17 |
| - notExactMatch: [ |
18 |
| - [1, ".className { background: url({./path/to/file.png}); }", ""] |
19 |
| - ] |
20 |
| - }; |
| 6 | + var css = ".className { background: url(./path/to/file.png); }"; |
| 7 | + var exports = { |
| 8 | + without: [ |
| 9 | + [1, ".className { background: url({./path/to/file.png}); }", ""] |
| 10 | + ], |
| 11 | + onlyModule: [ |
| 12 | + [1, ".className { background: url({module/file.png}); }", ""] |
| 13 | + ], |
| 14 | + exactMatch: [ |
| 15 | + [1, ".className { background: url({module/file.png}); }", ""] |
| 16 | + ], |
| 17 | + notExactMatch: [ |
| 18 | + [1, ".className { background: url({./path/to/file.png}); }", ""] |
| 19 | + ] |
| 20 | + }; |
21 | 21 |
|
22 |
| - function aliasOptions(alias) { |
23 |
| - return { options: { context: "", cssLoader: { alias: alias }}} |
24 |
| - } |
| 22 | + function aliasOptions(alias) { |
| 23 | + return { query: { alias: alias }} |
| 24 | + } |
25 | 25 |
|
26 |
| - test("without", css, exports.without); |
27 |
| - test("onlyModule", css, exports.onlyModule, aliasOptions({ "./path/to": "module" })); |
28 |
| - test("exactMatch", css, exports.exactMatch, aliasOptions({ "./path/to/file.png$": "module/file.png" })); |
29 |
| - test("notExactMatch", css, exports.notExactMatch, aliasOptions({ "./path/to/file.jpg$": "module/file.jpg" })); |
| 26 | + test("without", css, exports.without); |
| 27 | + test("onlyModule", css, exports.onlyModule, aliasOptions({ "./path/to": "module" })); |
| 28 | + test("exactMatch", css, exports.exactMatch, aliasOptions({ "./path/to/file.png$": "module/file.png" })); |
| 29 | + test("notExactMatch", css, exports.notExactMatch, aliasOptions({ "./path/to/file.jpg$": "module/file.jpg" })); |
30 | 30 | });
|
0 commit comments