Commit graph

42 commits

Author SHA1 Message Date
Paul Slaughter 2fa3c81a89
Add support for jh/jest.config.js 2021-11-09 09:29:43 -06:00
Vitaly Slobodin bd710a55b6 Remove Karma and anything related 2021-09-03 14:50:29 +00:00
Lukas Eipert 81e8287570 Run prettier on 15 files - 4 of 73
Part of our prettier migration; changing the arrow-parens style.
2020-12-23 18:48:02 +01:00
Denys Mishunov fa9028e0cf Fixing the JEST config for IDEs
When using an IDE or an editor, those expect jest.config.js in the
project's root if nothing else is specificed in the config. In case of
two separate configs, we would need to update the configs for every jest
spec run that is not very enjoyable.
2020-05-20 09:32:48 +02:00
Paul Slaughter ac4d7d0f2b
Add unit and integration jest.config files
**Why?**
To write [FE integration tests][1], we will need
to have two related but different environments.
The best way to do this is with two configs and
a base config.

[1]: https://docs.gitlab.com/ee/development/testing_guide/testing_levels.html#frontend-integration-tests
2020-05-15 08:21:34 -05:00
Himanshu Kapoor b7f914cdde
Allow usage of monaco-editor in Jest
Partial fix that allows usage of `monaco-editor` in Jest and not make
the tests outright fail.
2020-03-10 10:24:22 -05:00
Nicolò Maria Mezzopera e864524b75 Refactor mesh_object_spec to jest
- jest spec
- update jest config to transform three.js
2020-03-10 11:08:01 +00:00
Lukas Eipert f928baae9c
Jest: Enable bootstrap-vue to be transpilable 2020-02-28 17:13:05 +01:00
Albert Salim c5c8d083a3 Merge jest coverage reports
- create script to merge reports
- create CI job to perform merging
2020-02-21 11:32:44 +08:00
samdbeckham 8fdd62218e Adds the alias for jest tests
- Adds an alias to the jest config
- Adds an alias to webpack (just incase)
2020-01-20 12:00:08 +00:00
Winnie Hellmann cb0bf39245 Add clearMocks Jest config
**Why?**
This removes the need to add `jest.clearAllMocks` manually.
Without this, it's possible for tests to have false positives
because the `mock.calls` is never reset.

**References:**
- https://jestjs.io/docs/en/configuration#clearmocks-boolean
- https://gitlab.com/gitlab-org/gitlab/merge_requests/21860
2019-12-17 06:09:42 +00:00
Winnie Hellmann 92da6112bc Include ee/ in Jest coverage report 2019-12-09 08:51:50 +01:00
Paul Gascou-Vaillancourt 19c5993577 Migrate monitoring specs to Jest & VTU
Migrated monitoring specs that rely on tooltips
to Jest & Vue Test Utils
2019-11-04 10:12:58 -05:00
Winnie Hellmann 2da9242d2f Fix broken master in gitlab-foss (related_issuable_item_spec.js) 2019-10-30 15:16:23 +00:00
Lin Jen-Shin d58737fb00
Also run FOSS version of rspec, jest, karma
However we don't run FOSS system tests for now,
because it requires FOSS assets (perhaps?)

Let's run other tests first.
2019-10-04 20:14:58 +08:00
Winnie Hellmann b5baaf00b5 Update references in code from gitlab-ce to gitlab-foss 2019-09-26 10:52:10 +00:00
Illya Klymov 65fd541741 Add additional check in Jest config 2019-09-24 20:05:52 +00:00
Winnie Hellmann 570921c3fc Show error if Jest is used with Karma files 2019-09-18 13:52:10 +00:00
Winnie Hellmann bec35b5c6c Define alias spec/test_constants in Jest 2019-09-17 15:12:34 +02:00
Paul Slaughter c3c467e844 Fix flaky issue card spec 2019-09-13 22:19:02 +00:00
Winnie Hellmann 5bd4bcc3e3 Replace path with filename in Jest config 2019-07-11 11:13:01 +00:00
Winnie Hellmann a5d4c5879f Workaround ESLint only resolving paths in test files 2019-07-10 13:27:39 +00:00
Fatih Acet 99156dd760
Set timezone to GMT in Jest config 2019-05-02 12:54:55 +02:00
Paul Gascou-Vaillancourt 911701ae47 Extract discussion notes into new component
- Moved discussion notes out of `NoteableDiscussion` component into a
new `DiscussionNotes` component
- Wrote Jest tests for the new `DiscussionNotes` component
- Updated Jest config for emojis fixtures
- Updated Karma tests `NoteableDiscussion` to match its new structure
- Convert `DiffDiscussions` tests to use Vue test utils
2019-05-01 10:04:07 +00:00
Winnie Hellmann 7b4756162a Add ee_else_ce to Jest config 2019-04-05 11:14:22 +02:00
Winnie Hellmann 63f6fcd0b7 Set gon.ee in Jest 2019-03-28 18:17:10 +01:00
Winnie Hellmann 5a2d7bf245 Ignore Jest config from ESLint 2019-03-28 18:14:47 +01:00
Winnie Hellmann fbe1f8b4cb Provide custom Jest environment with mocked console 2019-03-26 20:49:05 +01:00
Winnie Hellmann 939140c33e Mock timers in Jest 2019-03-21 18:04:33 +01:00
Winnie Hellmann 55f76ce8f6 Revert "Merge branch 'winh-dequarantine-labels-autocomplete' into 'master'"
This reverts merge request !25542
2019-03-05 11:02:00 +00:00
Lukas Eipert c151cebaaa
Upgrade jest and related dependencies
This removes other outdated babel@6 dependencies as well.

Unfortunately the newer version of vue-jest has a dependency of an older
version of ts-jest. In order to satisfy the peerDependency from ts-jest,
we are forcing the version@24. The only "breaking" change from ts-jest
23->24 is that it requires a newer version of jest. This might be
obsolete soon, as vue-jest plans on switching to babel eventually.
2019-02-28 12:36:29 +01:00
Winnie Hellmann fb23a411d1 Add fixtures path to Jest config 2019-02-27 09:08:41 +01:00
Phil Hughes 224417e2b4 Added GraphQL Jest transform 2019-02-26 12:26:15 +00:00
Kushal Pandya a40bb1e8ec Merge branch 'winh-jest-gfm_auto_complete_spec' into 'master'
Move gfm_auto_complete_spec.js to Jest

See merge request gitlab-org/gitlab-ce!25463
2019-02-22 10:06:06 +00:00
Phil Hughes f6483cc3b8 Merge branch 'winh-jest-config' into 'master'
Setup Jest for EE (CE backport)

See merge request gitlab-org/gitlab-ce!25468
2019-02-22 08:36:20 +00:00
Winnie Hellmann db583a3387 Setup Jest for EE
(cherry picked from commit e760abdb08)
2019-02-21 15:49:48 +01:00
Winnie Hellmann 948df0e383 Add vendor/ to Jest aliases 2019-02-21 14:25:39 +01:00
Winnie Hellmann dc9a67652d Transpile @gitlab/ui for Jest 2019-02-21 11:02:32 +01:00
Winnie Hellmann 4b3573f2e9 Setup Jest for Vue 2018-12-11 15:03:59 +01:00
Winnie Hellmann 2c1d434331 Automatically restore all Jest mocks after each test
see https://jestjs.io/docs/en/configuration.html#restoremocks-boolean
2018-12-11 13:06:19 +01:00
Winnie Hellmann fac4d54f3d Fail long running tests 2018-12-11 13:06:19 +01:00
Winnie Hellmann ca3603de56 Move jest.config.js to root directory 2018-12-11 13:06:19 +01:00
Renamed from config/jest.config.js (Browse further)