Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/filter-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ describe('broccoli-asset-rev', function() {
});
});

it.only('rewrites template literals with prepends correctly', function(){
var sourcePath = 'tests/fixtures/template-literal';

var node = AssetRev(sourcePath + '/input', {
extensions: ['js', 'json', 'css', 'png', 'jpg', 'gif', 'map'],
prepend: 'https://static.assets.com/ember/'
});

builder = new broccoli.Builder(node);
return builder.build().then(function(graph) {
confirmOutput(graph.directory, sourcePath + '/output');
});
});

it("doesn't fingerprint rails-style manifest if excluded", function () {
var sourcePath = 'tests/fixtures/basic';

Expand Down
5 changes: 5 additions & 0 deletions tests/fixtures/template-literal/input/assets/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Application {
foo() {
return bar(`${this.path}/application.js`);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions tests/fixtures/template-literal/input/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">

<title>Application</title>

<link rel="stylesheet" href="/styles.css">
<link rel="icon" href="/images/icons/favicon.png">
</head>
<body>
<script type="text/javascript" src="/assets/application.js"></script>
<script type="text/javascript" src=/assets/application.js></script>
</body>
</html>
11 changes: 11 additions & 0 deletions tests/fixtures/template-literal/input/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.sample-img {
width: 50px;
height: 50px;
background-image: url(images/sample.png);
}

.sample-img2 {
width: 50px;
height: 50px;
background-image: url('images/sample.png');
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Application {
foo() {
return bar(`https://static.intercomassets.com/ember/${this.path}/application-974fd9b673bf8809fe7b5cf3898a6bbf.js`);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions tests/fixtures/template-literal/output/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">

<title>Application</title>

<link rel="stylesheet" href="/styles-65152d913114634ea19a82c7990d08f3.css">
<link rel="icon" href="/images/icons/favicon-9243e67fccd0c5e08a3d2c158af6500d.png">
</head>
<body>
<script type="text/javascript" src="/assets/application-974fd9b673bf8809fe7b5cf3898a6bbf.js"></script>
<script type="text/javascript" src=/assets/application-974fd9b673bf8809fe7b5cf3898a6bbf.js></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.sample-img {
width: 50px;
height: 50px;
background-image: url(images/sample-1f6b78f1b4667adc7e397f7bf94041ab.png);
}

.sample-img2 {
width: 50px;
height: 50px;
background-image: url('images/sample-1f6b78f1b4667adc7e397f7bf94041ab.png');
}