Migrate emoji_menu_spec.js to Jest
What does this MR do?
This moves emoji_menu_spec.js
to Jest and configures Jest to fail long running tests.
It reduces the time running emoji_menu_spec.js
individually takes to less than half:
yarn karma -f spec/javascripts/pages/profiles/show/emoji_menu_spec.js |
yarn jest spec/frontend/pages/profiles/show/emoji_menu_spec.js |
---|---|
yarn run v1.12.0 $ BABEL_ENV=${BABEL_ENV:=karma} karma start --single-run true config/karma.config.js -f spec/javascripts/pages/profiles/show/emoji_menu_spec.js ℹ 「wdm」: ℹ 「wdm」: Compiled successfully. 10 12 2018 13:01:20.149:INFO [karma]: Karma v3.0.0 server started at http://0.0.0.0:9876/ 10 12 2018 13:01:20.154:INFO [launcher]: Launching browser ChromeHeadlessCustom with unlimited concurrency 10 12 2018 13:01:20.205:INFO [launcher]: Starting browser Chrome 10 12 2018 13:01:22.624:INFO [Chrome]: Connected on socket nDMjSnyeJrumO0rlAAAA with id 75176442 Chrome: Executed 9 of 9 SUCCESS (0.135 secs / 0.127 secs) TOTAL: 9 SUCCESS ✨ Done in 10.88s. |
yarn run v1.12.0 $ BABEL_ENV=jest jest spec/frontend/pages/profiles/show/emoji_menu_spec.js PASS spec/frontend/pages/profiles/show/emoji_menu_spec.js EmojiMenu addAward ✓ calls selectEmojiCallback (66ms) ✓ does not make an axios requst (13ms) bindEvents ✓ binds event listeners to custom toggle button (1ms) ✓ binds event listeners to custom menu class (1ms) createEmojiMenu ✓ renders the menu with custom menu class (8ms) |
What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/issues/53757
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer
Edited by Inactive Account