Skip to content

Commit 7061c2c

Browse files
committed
added file test, remove unused [basename]
1 parent 527f943 commit 7061c2c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

test/configCases/plugins/banner-plugin-hashing/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ it("should interpolate chunkHash in chunk banner", () => {
2525
REGEXP_HASH.test(banner["chunkhash"]).should.be.true;
2626
});
2727

28+
it("should interpolate file into chunk banner", () => {
29+
banner["file"].should.equal("dist/banner.js");
30+
});
31+
2832
it("should interpolate name in chunk banner", () => {
2933
banner["name"].should.equal("dist/banner");
3034
});
@@ -37,8 +41,12 @@ it("should interpolate query in chunk banner", () => {
3741
banner["query"].should.equal("?value");
3842
});
3943

40-
it("should parse entry into basename", () => {
41-
banner["filebase"].should.not.equal("name");
44+
it("should parse entry into file in chunk banner", () => {
45+
banner["file"].should.not.equal(banner["filebase"]);
46+
});
47+
48+
it("should parse entry into name in chunk banner", () => {
49+
banner["filebase"].should.not.equal(banner["name"]);
4250
});
4351

4452
require.include("./test.js");

test/configCases/plugins/banner-plugin-hashing/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
},
1717
plugins: [
1818
new webpack.BannerPlugin({
19-
banner: "hash:[hash], chunkhash:[chunkhash], name:[name], filebase:[filebase], query:[query], basename:[basename]"
19+
banner: "hash:[hash], chunkhash:[chunkhash], name:[name], filebase:[filebase], query:[query], file:[file]"
2020
})
2121
]
2222
};

0 commit comments

Comments
 (0)