Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual mocking do not work for paths containing Webpack alias #9535

Closed
w-p-c opened this issue Feb 7, 2020 · 3 comments
Closed

Virtual mocking do not work for paths containing Webpack alias #9535

w-p-c opened this issue Feb 7, 2020 · 3 comments

Comments

@w-p-c
Copy link

w-p-c commented Feb 7, 2020

🐛 Bug Report

Test fails in attempt to virtually mock a nonexistent module whose path contains Webpack alias.

To Reproduce

  1. Initialize project with npx create-react-app myapp
  2. Execute npm run eject
  3. Create alias in Webpack config for nonexistent module
  4. Import nonexistent module via Webpack alias
  5. Virtually mock nonexistent module whose path contains Webpack alias
  6. Exception raised, even though virtual: true option is given

Expected behavior

Exception not raised, module virtually mocked and test continues execution.

Link to repl or repo (highly encouraged)

GitHub repository

envinfo

System:
    OS: Linux 5.3 Ubuntu 18.04.3 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  Binaries:
    Node: 13.5.0 - ~/.nvm/versions/node/v13.5.0/bin/node
    npm: 6.13.4 - ~/.nvm/versions/node/v13.5.0/bin/npm
  npmPackages:
    jest: 24.9.0 => 24.9.0
@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Feb 17, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2023
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants