Skip to content

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

  1. merge in minimal Jest setup (https://gitlab.com/gitlab-org/gitlab-ce/issues/53757)
  2. add axios mock and fail for pending requests (https://gitlab.com/gitlab-org/gitlab-ce/issues/33715)
  3. add Vue transform (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23686)
  4. support EE-specific tests (https://gitlab.com/gitlab-org/gitlab-ee/issues/9081)
  5. make Jest work with gitlab-ui (https://gitlab.com/gitlab-org/gitlab-ce/issues/56689)
  6. convert a small amount of tests from Karma to Jest as examples

Phase 2

  1. fail for Vue warnings and errors: https://gitlab.com/gitlab-org/gitlab-ce/issues/58203
  2. support running Jest tests in headless Chrome: https://gitlab.com/gitlab-org/gitlab-ce/issues/58205
  3. create Danger rule to favor Jest over Karma (as part of https://gitlab.com/gitlab-org/gitlab-ce/issues/49799?)
  4. 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