Skip to content

[INFRA] Setup test infrastructure #65

Description

@tbouffard

This is required prior moving forward with new features.
We already need it for:

We 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

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

About Verify "module" settings in the dedicated tsconfig.json file used in tests task

Resources that may help to setup ts-jest:

Metadata

Metadata

Assignees

Labels

choreBuild, CI/CD or repository tasks (issues/PR maintenance, environments, ...)

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions