Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(contributors): describe "npm package" tests #3141

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 `bundler` module resolution strategy
tbouffard marked this conversation as resolved.
Show resolved Hide resolved


## Running tests

See `package.json` for extra available scripts
Expand Down
10 changes: 10 additions & 0 deletions test/typescript-moduleResolution-bundler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@

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:
tbouffard marked this conversation as resolved.
Show resolved Hide resolved
- `npm install`
- `npm pack`


## Run

From the folder of this test project, run:
- `npm install`
- `npm test`
16 changes: 16 additions & 0 deletions test/typescript-support/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Validate the minimal TypeScript version supported by bpmn-visualization

## Setup

The `bpmn-visualization` npm package must be built first:

From the repository root, run:
tbouffard marked this conversation as resolved.
Show resolved Hide resolved
- `npm install`
- `npm pack`


## Run

From the folder of this test project, run:
- `npm install`
- `npm test`
Loading