Skip to content

Commit

Permalink
test: improve
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jun 4, 2021
1 parent 422e374 commit c95c897
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/serve/serve-variable/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const isInProcess = process.env.WEBPACK_SERVE;
const HAS_WEBPACK_SERVE = process.env.WEBPACK_SERVE;

class CustomTestPlugin {
constructor(isInEnvironment) {
this.isInEnvironment = isInEnvironment;
}
apply(compiler) {
compiler.hooks.done.tap("testPlugin", () => {
if (!isInProcess && this.isInEnvironment) {
if (this.isInEnvironment) {
console.log("PASS");
} else {
console.log("FAIL");
Expand All @@ -19,6 +19,6 @@ module.exports = (env) => {
return {
mode: "development",
devtool: false,
plugins: [new CustomTestPlugin(env.WEBPACK_SERVE)],
plugins: [new CustomTestPlugin(HAS_WEBPACK_SERVE && env.WEBPACK_SERVE)],
};
};

0 comments on commit c95c897

Please sign in to comment.