6 Commits

Author SHA1 Message Date
Gaetan Craig-Riou
b9a790ba20 Per review, comment out transform configuration
We are using the default one, no need to actually specify it, and also
updated the documentaion link to the latest documentation.
2025-11-14 10:32:14 +11:00
Gaetan Craig-Riou
b96a0875f3 Turn on cleaning up of globals.
It will be come default in future jest release, currently jest isn't
emitting any warning so there is no reason to wait to turn it on.
2025-11-13 09:44:22 +11:00
Gaetan Craig-Riou
2729fb14d6 Fix jest configuration to work with version 28
Per migration guide : https://jest-archive-august-2023.netlify.app/docs/28.x/upgrading-to-jest28/
2025-11-11 14:58:43 +11:00
Gaetan Craig-Riou
c5d5694f24 Tweaked jest configuration
- include app/components in the directories to search for modules, ie we
  can require view component js controller like this :
  `import tag_list_input_controller from "tag_list_input_component/tag_list_input_controller";`
- fixed the regexp to skip transformation so it skips any modules
  starting by "stimulus"
2025-11-03 14:25:05 +11:00
Gaetan Craig-Riou
94030527a4 Update jest configuration to include webpacker dir
This allows the test environment to correctly resolve import of
services in controller ie: `import OptionValueNamer from
"js/services/option_value_namer";`

The added benefit is we can now import package to be tested directly
without having to specify the whole relative path ie in test file you
can do : `import variant_controller from "controllers/variant_controller";`
2024-10-14 15:01:18 +11:00
David Cook
11b8a01220 Move Jest config to a file
With the help of 'jest --init'

I didn't end up using this, but it seems worth keeping config out of package.json
2024-03-27 20:20:20 +11:00