diff --git a/docs/contributors/supported-typescript-version.md b/docs/contributors/supported-typescript-version.md index 44a3425ae4..01aa256cf7 100644 --- a/docs/contributors/supported-typescript-version.md +++ b/docs/contributors/supported-typescript-version.md @@ -25,5 +25,6 @@ The README file mentions the oldest supported version of TypeScript. Update the Update the `typesVersions` attribute in the `package.json` file. This attribute is central. -Run the automatic tests from the `test/typescript-support` directory: `npm test`. They should fail as they are currently using a too old TypeScript version. +Run the automatic tests from the `test/typescript-support` directory (see the [typescript-support README](../../test/typescript-support/README.md)). They should fail as they are currently using a too old TypeScript version. + Update the TypeScript version in the `package.json` file and run the tests again. They should now succeed. diff --git a/docs/contributors/testing.md b/docs/contributors/testing.md index d127f87bc1..233fe15506 100644 --- a/docs/contributors/testing.md +++ b/docs/contributors/testing.md @@ -211,6 +211,13 @@ Preview is available in the browser, simply open file `/bpmn-visu-js/test/perfor They ensure that the bundles provided in the npm package are working, and they are defined under `/test/bundles/`. +### Npm package tests + +These tests are validating the usage of the npm package in TypeScript applications: +- [typescript-support](../../test/typescript-support): validate the [minimal TypeScript version](./supported-typescript-version.md) supported by the library +- [typescript-moduleResolution-bundler](../../test/typescript-moduleResolution-bundler): validate that the library can be used with the `bundler` module resolution strategy + + ## Running tests See `package.json` for extra available scripts diff --git a/test/typescript-moduleResolution-bundler/README.md b/test/typescript-moduleResolution-bundler/README.md index 22f27663e3..4f68a3e596 100644 --- a/test/typescript-moduleResolution-bundler/README.md +++ b/test/typescript-moduleResolution-bundler/README.md @@ -2,7 +2,15 @@ Relates to [missing types configuration in the package.json "exports" field](https://github.com/process-analytics/bpmn-visualization-js/pull/2972). +## Setup + +The `bpmn-visualization` npm package must be built first. From the repository root, run: +- `npm install` +- `npm pack` + + ## Run +From the folder of this test project, run: - `npm install` - `npm test` diff --git a/test/typescript-support/README.md b/test/typescript-support/README.md new file mode 100644 index 0000000000..8b13e16b08 --- /dev/null +++ b/test/typescript-support/README.md @@ -0,0 +1,14 @@ +# Validate the minimal TypeScript version supported by bpmn-visualization + +## Setup + +The `bpmn-visualization` npm package must be built first. From the repository root, run: +- `npm install` +- `npm pack` + + +## Run + +From the folder of this test project, run: +- `npm install` +- `npm test`