Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #1147
Closed
Open
Issue created Dec 04, 2016 by Administrator@rootContributor

FileStub.js used for lodash modules :-(

Created by: kentcdodds

Can you reproduce the problem with latest npm?

Yes

Description

Due to this config for Jest, lodash.<method-name> modules are stubbed out as test-file-stub. These are quite commonly used in common modules. For example, cheerio (used by enzyme) uses lodash.assignin for _.extend behavior and because the regex used in the Jest config matches lodash. modules, it is mocked.

Expected behavior

Don't mock modules which resolve to modules ending in .js

Actual behavior

Mocks any modules referenced with a . in their name (even if they resolve to .js modules via normal CommonJS resolution semantics).

Environment

Mostly Irrelevant. I'm using v0.8.0 of react-scripts

Reproducible Demo

Happy to make a demo if that's needed, but I think the issue is pretty clear. The solution... I think that we need to go back from a blacklist (like we have now) to a whitelist (like we had before)... Effectively reverting #1077 which was meant to address #667 (closed), but unfortunately had this pretty serious side-effect :-(

I imagine that considering react-scripts was released only about 10 hours ago, you'll start to see more and more people with this same issue. It would probably be good to get this fixed quickly to minimize impact.

Assignee
Assign to
Time tracking