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
  • !216

Add a test runner and template Enzyme test.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/wdhorton/add-testing into master Jul 26, 2016
  • Overview 21
  • Commits 1
  • Pipelines 0
  • Changes 13

Created by: wdhorton

I put this together to show how we can add a test runner to the project. Discussion of exactly which test runner to use is ongoing, so I don't want to focus too much on that part. The Mocha-specific part of this is relatively minor, and could be swapped for a different framework relatively easily.

The main part is setting up a test config for Webpack and creating an entry point to bundle all the tests. Note that the first argument to require.context has to be a constant string (see issue here), which is why I made three different entry point files to handle where the file is in relation to the app's src directory. Definitely open to a more straightforward solution if anyone has suggestions.

The test plan: right now I'm planning to add on to the existing e2e.sh test, since the other scripts use that.

I think getting testing that "just works" is an important part of this project, and I'm excited to see where we can go with this!

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/wdhorton/add-testing