diff --git a/test/configCases/plugins/banner-plugin/index.js b/test/configCases/plugins/banner-plugin/index.js index 69d83ba559a..e25486c1af1 100644 --- a/test/configCases/plugins/banner-plugin/index.js +++ b/test/configCases/plugins/banner-plugin/index.js @@ -13,11 +13,15 @@ it("should contain banner in bundle0 chunk", () => { expect(source).toMatch( "/*!\n * trim trailing whitespace\n *\n * no trailing whitespace\n */" ); + expect(source).not.toMatch(new RegExp("^/*! A test value in single file */$")); + expect(source).not.toMatch(new RegExp("^/*! Match test file */$")); }); it("should not contain banner in vendors chunk", () => { const source = fs.readFileSync(path.join(__dirname, "vendors.js"), "utf-8"); - expect(source).not.toMatch("A test value"); + expect(source).not.toMatch("/*! A test value */"); + expect(source).toMatch("/*! A test value in single file */"); + expect(source).toMatch("/*! Match test file */"); }); if (Math.random() < 0) require("./test.js"); diff --git a/test/configCases/plugins/banner-plugin/webpack.config.js b/test/configCases/plugins/banner-plugin/webpack.config.js index ced05eea136..db79e3b1d9c 100644 --- a/test/configCases/plugins/banner-plugin/webpack.config.js +++ b/test/configCases/plugins/banner-plugin/webpack.config.js @@ -19,6 +19,14 @@ module.exports = { banner: "A test value", exclude: ["vendors.js"] }), + new webpack.BannerPlugin({ + banner: "A test value in single file", + include: ["vendors.js"] + }), + new webpack.BannerPlugin({ + banner: "Match test file", + test: /vendors\.js$/ + }), new webpack.BannerPlugin({ banner: ({ chunk }) => `multiline\nbanner\n${chunk.name}` }),