diff options
author | Evan Read <eread@gitlab.com> | 2019-09-10 07:44:37 +0000 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2019-09-10 07:44:37 +0000 |
commit | 4e9a93a38d0bbc6940a54b484b5d902f2d481a4d (patch) | |
tree | 8a115f48d3aa3aef42deb9bd104538c9024484c8 | |
parent | 7eda144e3e6557b7f42d02a1eeff157d580ca9d1 (diff) | |
parent | d43c09d7b1c24321c7cb2003ce981f3ee4cfe6f1 (diff) | |
download | gitlab-ce-4e9a93a38d0bbc6940a54b484b5d902f2d481a4d.tar.gz |
Merge branch 'docs-update-jest-with-when-to-use-section' into 'master'
Docs: Add when to use Jest section in frontend_testing
See merge request gitlab-org/gitlab-ce!32760
-rw-r--r-- | doc/development/testing_guide/frontend_testing.md | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/doc/development/testing_guide/frontend_testing.md b/doc/development/testing_guide/frontend_testing.md index 7dc89a3fcdb..91004bf177d 100644 --- a/doc/development/testing_guide/frontend_testing.md +++ b/doc/development/testing_guide/frontend_testing.md @@ -20,9 +20,18 @@ We have started to migrate frontend tests to the [Jest](https://jestjs.io) testi Jest tests can be found in `/spec/frontend` and `/ee/spec/frontend` in EE. -It is not yet a requirement to use Jest. You can view the -[epic](https://gitlab.com/groups/gitlab-org/-/epics/873) of issues -we need to solve before being able to use Jest for all our needs. +### When should I use Jest over Karma? + +If you need to update an existing Karma test file (found in `spec/javascripts`), you do not +need to migrate the whole spec to Jest. Simply updating the Karma spec to test your change +is fine. It is probably more appropriate to migrate to Jest in a separate merge request. + +If you need to create a new test file, we strongly recommend creating one in Jest. This will +help support our migration and we think you'll love using Jest. + +As always, please use discretion. Jest solves a lot of issues we experienced in Karma and +provides a better developer experience, however there are potentially unexpected issues +which could arise (especially with testing against browser specific features). ### Differences to Karma |