This is required prior moving forward with new features.
We already need it for:
Based on various POC, we will use jest and ts-jest. See
We already use this infrastructure in bpmn-visualization, so this will also ease the move of implementation and tests between the 2 projects.
### Tasks to setup ts-jest
- [x] Use #96 as a starting point
- [x] Migrate all existing JavaScript tests to TypeScript
- [x] Verify "module" settings in the dedicated tsconfig.json file used in tests: Keep values from the tsconfig file used to transpile addons sources.
- [x] Dedicated tsconfig.json file used in tests. Enable sourceMap and verify that tests can be debugged. With js tests, the lib must built with ` tsc --watch --sourceMap` to debug tests
- [x] jest config: make type guidance work in IDE for ts-jest (adapt existing type)
- [x] jest config. According to https://jestjs.io/docs/configuration#modulefileextensions-arraystring, the ts extension should be set at the first place - "We recommend placing the extensions most commonly used in your project on the left"
- [x] Update the dependabot config to add new jest dependencies to the jest group
This is required prior moving forward with new features.
We already need it for:
BpmnElementsSearcher#3PathResolver#18We could use ts-jest and jest-jsdom as done in
bpmn-visualization.Interesting alternatives could be evaluated as well
Decisions
Based on various POC, we will use jest and ts-jest. See
avato run TypeScript tests [POC] #81jestto run TypeScript tests [POC] #82We already use this infrastructure in bpmn-visualization, so this will also ease the move of implementation and tests between the 2 projects.
About Verify "module" settings in the dedicated tsconfig.json file used in tests task
mtsfiles and we are not using such extension. (https://kulshekhar.github.io/ts-jest/docs/guides/esm-support#support-mts-extension)Resources that may help to setup
ts-jest: