Skip to content

Commit

Permalink
docs(contributors): describe "npm package" tests (#3141)
Browse files Browse the repository at this point in the history
Improve the README of the related test applications and add cross-links
in the documentation.
  • Loading branch information
tbouffard authored Aug 13, 2024
1 parent eee7809 commit 449a3c5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/contributors/supported-typescript-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
7 changes: 7 additions & 0 deletions docs/contributors/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions test/typescript-moduleResolution-bundler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
14 changes: 14 additions & 0 deletions test/typescript-support/README.md
Original file line number Diff line number Diff line change
@@ -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`

0 comments on commit 449a3c5

Please sign in to comment.