Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • Merge requests
  • !1149

Revert Jest moduleNameMapper regex back to a whitelist

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/fson/fix-jest-stubs into master 8 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: fson

Jest matches moduleNameMapper regexes with module names, not the full file path, so the negative lookahead doesn’t work for filtering out JS files, because they can be imported without the extension. So paths like lodash.assign and ../utils/range were mislabeled as resources with unknown file extensions because they have a dot in the name.

As a stopgap measure, revert the moduleNameMapper regex added in #1077.

This will fix issues #1145 (closed) and #1147 (closed). However, since the behaviour will now differ for obscure file extensions not listed in the whitelist, we should try to find a way to support the same behaviour as we have for webpack loaders (map any unknown file type mapped to a stub).

Activity

  • Loading
Please register or sign in to reply
  1. 04 Dec, 2016 1 commit
    • Ville Immonen's avatar
      Revert Jest moduleNameMapper regex back to a whitelist · 3ab6d438
      Ville Immonen authored 8 years ago
      Jest matches moduleNameMapper regexes with module names, not the full
      file path, so the negative lookahead doesn’t work for filtering out
      JS files, because they can be imported without the extension. So paths
      like `lodash.assign` and `../utils/range` were mislabeled as resources
      with unknown file extensions because they have a dot in the name.
      
      As a stopgap measure, revert the moduleNameMapper regex added in #1077.
      3ab6d438
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
3
CI skip-changelog v5
3
CI skip-changelog v5
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: twbs/bootstrap!37751
Source branch: github/fork/fson/fix-jest-stubs

Menu

Explore Projects Groups Snippets