Skip to content

Import JSON fixtures as modules

Albert requested to merge 339346-link-frontend-fixtures-jest into master

What does this MR do and why?

Change loading of JSON fixtures from reading file to requiring as module. This would allow Jest to track dependency on JSON fixtures, paving way for further work related to #339343 (closed)

Screenshots or screen recordings

Before:

$ jest --config jest.config.js --listTests --findRelatedTests tmp/tests/frontend/fixtures-ee/api/freeze-periods/freeze_periods.json

Done in 15.44s.

After:

$ jest --config jest.config.js --listTests --findRelatedTests tmp/tests/frontend/fixtures-ee/api/freeze-periods/freeze_periods.json
spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js
spec/frontend/deploy_freeze/components/deploy_freeze_settings_spec.js
spec/frontend/deploy_freeze/components/deploy_freeze_modal_spec.js
spec/frontend/deploy_freeze/store/actions_spec.js
spec/frontend/deploy_freeze/components/deploy_freeze_table_spec.js
spec/frontend/deploy_freeze/store/mutations_spec.js
Done in 19.39s.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #339346 (closed)

Edited by Albert

Merge request reports