Skip to content

Commit ff29fc3

Browse files
test: fix
1 parent bdb96dd commit ff29fc3

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
collectCoverage: true,
3+
collectCoverageFrom: ["src/**/*"],
34
testEnvironment: "node",
45
testTimeout: 60000,
56
transformIgnorePatterns: ["node_modules/(?!(arrify)/)"],

src/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,11 @@ class ESLintWebpackPlugin {
8787
*/
8888
async run(compiler, options, wanted, exclude) {
8989
// Do not re-hook
90-
/* istanbul ignore if */
91-
if (
92-
compiler.hooks.thisCompilation.taps.some(({ name }) => name === this.key)
93-
) {
94-
return;
95-
}
90+
const isCompilerHooked = compiler.hooks.compilation.taps.find(
91+
({ name }) => name === this.key,
92+
);
93+
94+
if (isCompilerHooked) return;
9695

9796
compiler.hooks.compilation.tap(this.key, async (compilation) => {
9897
/** @type {import('./linter').Linter} */

test/formatter-write.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("formatter write", () => {
3333

3434
it("should write results to absolute file with a same formatter", (done) => {
3535
const outputFilename = "outputReport-absolute.txt";
36-
const outputFilepath = join(__dirname, "output", outputFilename);
36+
const outputFilepath = join(__dirname, "outputs", outputFilename);
3737
const config = conf("error", {
3838
outputReport: {
3939
filePath: outputFilepath,

0 commit comments

Comments
 (0)