| 1 | const isInProcess = process.env.WEBPACK_WATCH; |
| 2 | |
| 3 | class CustomTestPlugin { |
| 4 | constructor(isInEnvironment) { |
| 5 | this.isInEnvironment = isInEnvironment; |
| 6 | } |
| 7 | |
| 8 | apply(compiler) { |
| 9 | compiler.hooks.done.tap("testPlugin", () => { |
| 10 | if (!isInProcess && this.isInEnvironment) { |
| 11 | console.log("PASS"); |
| 12 | } else { |
| 13 | console.log("FAIL"); |
| 14 | } |
| 15 | }); |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | module.exports = (env) => ({ |
| 20 | mode: "development", |
nothing calls this directly
no outgoing calls
no test coverage detected