@@ -31,7 +31,7 @@ describe('broccoli-asset-rev', function () {
3131 src: url('fonts/Fiz/Light/Fiz-Light.eot');
3232 src: url('fonts/Fiz/Light/Fiz-Light.eot?#iefix') format('embedded-opentype'), url('fonts/Fiz/Light/Fiz-Light.woff') format('woff'), url('fonts/Fiz/Light/Fiz-Light.ttf') format('truetype'), url('fonts/Fiz/Light/Fiz-Light.svg#Fiz') format('svg');
3333 }
34-
34+
3535 @font-face {
3636 font-family: Fiz;
3737 font-weight: 200;
@@ -62,7 +62,7 @@ describe('broccoli-asset-rev', function () {
6262 src: url('fonts/Fiz/Light/fingerprinted-Fiz-Light.eot');
6363 src: url('fonts/Fiz/Light/fingerprinted-Fiz-Light.eot?#iefix') format('embedded-opentype'), url('fonts/Fiz/Light/fingerprinted-Fiz-Light.woff') format('woff'), url('fonts/Fiz/Light/fingerprinted-Fiz-Light.ttf') format('truetype'), url('fonts/Fiz/Light/fingerprinted-Fiz-Light.svg#Fiz') format('svg');
6464 }
65-
65+
6666 @font-face {
6767 font-family: Fiz;
6868 font-weight: 200;
@@ -521,4 +521,44 @@ describe('broccoli-asset-rev', function () {
521521
522522 expect ( run2ProcessedCount ) . to . equal ( 0 ) ;
523523 } ) ;
524+
525+ it ( 'ignores remote URLs' , async function ( ) {
526+ var sourcePath = 'tests/fixtures/remote-url' ;
527+ var node = new AssetRewrite ( sourcePath + '/input' , {
528+ replaceExtensions : [ 'js' ] ,
529+ assetMap : {
530+ 'the.map' : 'the-other-map' ,
531+ 'app.js' : 'http://cdn.absolute.com/app.js' ,
532+ } ,
533+ prepend : '/' ,
534+ } ) ;
535+
536+ let output = createBuilder ( node ) ;
537+
538+ await output . build ( ) ;
539+
540+ expect ( output . read ( ) ) . to . deep . equal ( {
541+ 'snippet.js' : '<script src="http://example.com/app/app.js"></script>\n' ,
542+ } ) ;
543+ } ) ;
544+
545+ it ( 'ignores partial matches' , async function ( ) {
546+ var sourcePath = 'tests/fixtures/partial-match' ;
547+ var node = new AssetRewrite ( sourcePath + '/input' , {
548+ replaceExtensions : [ 'js' ] ,
549+ assetMap : {
550+ 'the.map' : 'the-other-map' ,
551+ 'app.js' : 'http://cdn.absolute.com/app.js' ,
552+ } ,
553+ prepend : '/' ,
554+ } ) ;
555+
556+ let output = createBuilder ( node ) ;
557+
558+ await output . build ( ) ;
559+
560+ expect ( output . read ( ) ) . to . deep . equal ( {
561+ 'snippet.js' : '<script src="other-app/app.js"></script>\n' ,
562+ } ) ;
563+ } ) ;
524564} ) ;
0 commit comments