Skip to content

Commit 52d8fbc

Browse files
author
Diogo Franco (Kovensky)
committed
Add test cases
1 parent 684dbc6 commit 52d8fbc

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default "ok";
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var should = require('should')
2+
3+
it("should parse template strings in System.import", function(done) {
4+
var name = "abc".split("");
5+
Promise.all([
6+
System.import(`./abc/${name[0]}${name[1]}${name[2]}Test`),
7+
System.import(String.raw`./${name.join("")}/${name.join("")}Test`)
8+
])
9+
.then(function (imports) {
10+
for (var i = 0; i < imports.length; i++) {
11+
imports[i].default.should.eql("ok");
12+
}
13+
})
14+
.then(function () { done(); }, done)
15+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var supportsTemplateStrings = require("../../../helpers/supportsTemplateStrings");
2+
3+
module.exports = function(config) {
4+
return !config.minimize && supportsTemplateStrings();
5+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = function supportsTemplateStrings() {
2+
try {
3+
var f = eval("(function f() { return String.raw`a\\b`; })");
4+
return f() === "a\\b";
5+
} catch(e) {
6+
return false;
7+
}
8+
};

0 commit comments

Comments
 (0)