Migration plan from Karma to Jest
Evaluating Jest as a new test environment was successful (https://gitlab.com/gitlab-org/gitlab-ce/issues/49171#note_107466861). This issue describes our plan for migrating the frontend test suite.
Phase 1
- merge in minimal Jest setup (https://gitlab.com/gitlab-org/gitlab-ce/issues/53757)
- add axios mock and fail for pending requests (https://gitlab.com/gitlab-org/gitlab-ce/issues/33715)
- add Vue transform (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23686)
- support EE-specific tests (https://gitlab.com/gitlab-org/gitlab-ee/issues/9081)
- make Jest work with gitlab-ui (https://gitlab.com/gitlab-org/gitlab-ce/issues/56689)
- convert a small amount of tests from Karma to Jest as examples
Phase 2
- fail for Vue warnings and errors: https://gitlab.com/gitlab-org/gitlab-ce/issues/58203
- support running Jest tests in headless Chrome: https://gitlab.com/gitlab-org/gitlab-ce/issues/58205
- create Danger rule to favor Jest over Karma (as part of https://gitlab.com/gitlab-org/gitlab-ce/issues/49799?)
- start porting existing tests by directory
Each of the steps happens in a separate merge request. After Phase 1 is completed everybody should be able to write tests in Jest.
Edited by Inactive Account