Closed Bug 1872683 Opened 5 months ago Closed 5 months ago

ESLint Jest failures when upgrading eslint-plugin-jest to v27.6.1

Categories

(DevTools :: Debugger, task)

task

Tracking

(firefox123 fixed)

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: standard8, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

As part of regularly upgrading ESLint, and heading towards ESLint v9, I'm attempting to ensure our packages our updated, so that we can pick up any v9 specific changes ahead of time, to make updating easier.

When I update eslint-plugin-jest to v27.6.1, there are a number of failures that are present.

Please can someone take a look at fixing these?

To do the upgrade locally:

  • Update package.json to set eslint-plugin-jest to "27.6.1"
  • Update devtools/client/debugger/src/.eslintrc.js to include this snippet at the top-level of the module.exports:
  settings: {
    jest: {
      version: 27,
    },
  },
  • Run rm -r node_modules package-lock.json && ./mach npm install to regenerate the node modules installation.
  • Run ESLint as normal, e.g. ./mach eslint . or ./mach eslint devtools/client/debugger

The current errors are below. Some of these are automatically fixable with --fix.

devtools/client/debugger/src/actions/sources/tests/blackbox.spec.js
  15:6  error  should not have leading or trailing spaces  jest/valid-title (eslint)

devtools/client/debugger/src/components/Editor/Preview/tests/Popup.spec.js
   33:7  error  Avoid calling `expect` conditionally`  jest/no-conditional-expect (eslint)
   38:7  error  Avoid calling `expect` conditionally`  jest/no-conditional-expect (eslint)
   99:7  error  Avoid calling `expect` conditionally`  jest/no-conditional-expect (eslint)
  104:7  error  Avoid calling `expect` conditionally`  jest/no-conditional-expect (eslint)

devtools/client/debugger/src/components/Editor/tests/ConditionalPanel.spec.js
  65:6  error  should not have duplicate prefix  jest/valid-title (eslint)
  69:6  error  should not have duplicate prefix  jest/valid-title (eslint)
  73:6  error  should not have duplicate prefix  jest/valid-title (eslint)

devtools/client/debugger/src/components/shared/Button/tests/PaneToggleButton.spec.js
  39:6  error  should not have leading or trailing spaces  jest/valid-title (eslint)

devtools/client/debugger/src/reducers/tests/breakpoints.spec.js
  17:6  error  should not have duplicate prefix  jest/valid-title (eslint)
  41:6  error  should not have duplicate prefix  jest/valid-title (eslint)

devtools/client/debugger/src/utils/breakpoint/tests/index.spec.js
  10:6  error  should not have leading or trailing spaces  jest/valid-title (eslint)

devtools/client/debugger/src/utils/editor/tests/source-documents.spec.js
  27:8  error  should not have leading or trailing spaces  jest/valid-title (eslint)

devtools/client/debugger/src/utils/tests/result-list.spec.js
  19:6  error  should not have leading or trailing spaces  jest/valid-title (eslint)

devtools/client/debugger/src/workers/pretty-print/tests/prettyFast.spec.js
  415:8  error  Title must be a string  jest/valid-title (eslint)

devtools/client/debugger/src/workers/search/tests/get-matches.spec.js
  53:8  error  should not have duplicate prefix  jest/valid-title (eslint)

I'll have a look

Blocks: eslint-v9
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1a6deecdb288
[devtools] Prepare debugger jest test for eslint-plugin-jest 27.6.1 update. r=Standard8,devtools-reviewers,ochameau
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: