Skip to content

Version 6.6.0 has incorrect imports for lodash/isEqualWith. #641

Closed
@adriantrunzo

Description

@adriantrunzo
  • @testing-library/jest-dom version: 6.6.0
  • node version: 20.17.0
  • jest (or vitest) version: vitest 2.1.2
  • npm (or yarn) version: pnpm 9.12

Relevant code or config:

The node_modules/@testing-library/jest-dom/dist/vitest.mjs file currently reads:

import { expect } from 'vitest';
import { e as extensions } from './matchers-12582698.mjs';
import 'redent';
import '@adobe/css-tools';
import 'dom-accessibility-api';
import 'aria-query';
import 'chalk';
import 'lodash/isEqualWith.js';
import 'css.escape';
import 'lodash/isEqualWith';

/* istanbul ignore file */


expect.extend(extensions);

All other dist files have the same problem.

Notice the two different imports of lodash/isEqualWith. The second one is incorrect and was added in #637 : https://github.com/testing-library/jest-dom/pull/637/files#diff-a136cc1088d17955bf3e51c2cb464c75890d15a5a008c05a9d17c68609b0a2f5R1.

See also: https://github.com/search?q=repo%3Atesting-library%2Fjest-dom%20lodash%2FisEqualWith&type=code

What you did:

Try to upgrade to 6.6.0.

What happened:

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 8 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Error: Cannot find module '/Users/.../node_modules/.pnpm/@[email protected]/node_modules/lodash/isEqualWith' imported from /Users/.../node_modules/.pnpm/@[email protected]/node_modules/@testing-library/jest-dom/dist/vitest.mjs
Did you mean to import "lodash/isEqualWith.js"?
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/8]

Reproduction:

Problem description:

Incorrect import.

Suggested solution:

Change the import of lodash/isEqualWith in src/to-have-selection.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions