Skip to content

[Bug]: Module not found using Jest but working without #12225

@BenjD90

Description

@BenjD90

Version

27.4.7

Steps to reproduce

Hello,

To reproduce the bug, simply try to import the module "eslint/use-at-your-own-risk" in a jest test, directly or indirectly.

Here a reproduction with very little (less than 10) lines of codes : https://replit.com/@BenjaminDaniel1/Eslint-use-eslintuse-at-your-own-risk-builtinRules?v=1

Thank you for your ideas to fix this,
Benjamin

Expected behavior

The module is well imported, using require.

Actual behavior

Module is "not found" when imported in a test.

Additional context

I'm using it in case of EsLint shared configuration testing.

Environment

System:
    OS: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (16) x64 Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz
  Binaries:
    Node: 14.18.2 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 6.14.15 - /usr/local/bin/npm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions