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
  • Merge requests
  • !3860

Enable jest cacheDirectory configuration

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/JReinhold/enable_jest_cache_option into next Jan 18, 2018
  • Overview 4
  • Commits 4
  • Pipelines 0
  • Changes 2

Created by: JReinhold

Fixes #2687 (closed) .

Enables the user to override Jest's cacheDirectory configuration, mainly to make it easier for users to speed up their builds on CI, by caching jest's cache in between builds.

How I tested

  • Test that it breaks without modification
    • Don't modify anything.
    • Add "jest": { "cacheDirectory": "tmp/jest-cache" } to /packages/react-scripts/package.json
    • Run yarn test
    • See that it complaints about overriding cacheDirectory
  • Test that it works with modified code
    • Add modification to code
    • Repeat above
    • See that it doesn't complain
    • See that a new folder tmp/jest-cache is created in /packages/react-scripts/template/
    • Re-run tests
    • See that it still works
  • Test that it works in generated app
    • run yarn create-react-app a-test-app
    • Repeat above steps in the newly generated app
    • See that it still works

Documentation

I've added cacheDirectory to the list of supported overrides in the template README.md. I've also added resetMocks, resetModules and watchPathIgnorePattern as they weirdly wasn't on the list, even though the are supported. If they are omitted on purpose, I'm sorry, I'll remove them again. I've also added a short section about using the cacheDirectory option to speed up tests on CI.

Future work

Should this be accepted, I'll gladly looking into speeding up this repos tests using the cacheDirectory pattern. However I'm inexperienced with TravisCI so I might come up short. Please let me know in the comments if I should pursue this or not.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/JReinhold/enable_jest_cache_option