This repository was archived by the owner on Oct 9, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,32 @@ describe('CSS Builder', function() {
2525 } ) ;
2626 } ) ;
2727
28+ describe ( 'with a browserRootURL config' , function ( ) {
29+ it ( 'should preprend it to a relative url(...) reference' , function ( ) {
30+ var builder = new Builder ( ) ;
31+ builder . config ( System . getConfig ( ) ) ;
32+ builder . config ( {
33+ browserRootURL : 'https://example.com/' ,
34+ rootURL : './test'
35+ } ) ;
36+ return builder . compile ( 'test/data/test.css!' , { minify : false } ) . then ( ( results ) => {
37+ return expect ( results . source ) . to . contain ( "body{background-color:red;background-image:url(https://example.com/data/x.png)}" ) ;
38+ } ) ;
39+ } ) ;
40+
41+ it ( 'should preprend it to a root-relative url(...) reference' , function ( ) {
42+ var builder = new Builder ( ) ;
43+ builder . config ( System . getConfig ( ) ) ;
44+ builder . config ( {
45+ browserRootURL : 'https://example.com/' ,
46+ rootURL : './test'
47+ } ) ;
48+ return builder . compile ( 'test/data/rootRelative.css!' , { minify : false } ) . then ( ( results ) => {
49+ return expect ( results . source ) . to . contain ( "body{background-color:red;background-image:url(https://example.com/path/to/x.png)}" ) ;
50+ } ) ;
51+ } ) ;
52+ } ) ;
53+
2854 it ( 'Should support buildCSS: false' , function ( ) {
2955 var builder = new Builder ( ) ;
3056 builder . config ( System . getConfig ( ) ) ;
Original file line number Diff line number Diff line change 1+ @import "./dep.css" ;
2+
3+ body {
4+ background-color : red;
5+ background-image : url (/path/to/x.png);
6+ }
You can’t perform that action at this time.
0 commit comments