Skip to content

Commit e88ae21

Browse files
committed
picked test cases from @lettertwo #8
1 parent 1b82675 commit e88ae21

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/loaderTest.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,16 @@ describe("loader", function() {
4141
'module.exports = "<h3>#{number} {customer}</h3><p>{title}</p><img src=" + require("./image.png") + ">";'
4242
);
4343
});
44-
});
44+
it("should not translate root-relative urls (without root query)", function() {
45+
loader.call({}, 'Text <img src="/image.png">').should.be.eql(
46+
'module.exports = "Text <img src=\\"/image.png\\">";'
47+
);
48+
});
49+
it("should accept root from query", function() {
50+
loader.call({
51+
query: "?root=/test/"
52+
}, 'Text <img src="/image.png">').should.be.eql(
53+
'module.exports = "Text <img src=\\"" + require("/test/image.png") + "\\">";'
54+
);
55+
});
56+
});

0 commit comments

Comments
 (0)