Skip to content

Commit

Permalink
Change GitHub actions for jest tests to use node 17 to support struct…
Browse files Browse the repository at this point in the history
…uredClone()
  • Loading branch information
fongsean committed Sep 25, 2024
1 parent 16e231b commit 06bcf49
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_test_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
run: cd apps/demo-renderer-app && npm run build

jest-test:
name: Jest Tests
name: Jest Tests (only runs on node 18)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: npm
- name: Install dependencies
run: npm ci
Expand Down
14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ If possible, it is recommended to merge the `main` branch into your branch first

## Development dependencies

You will need the following software to build the solution:
You will need the following software to build the solution and run the tests:

* Node.js 16.x or 18.x
* Node.js 18.x or later versions

To build and install locally, run in the root folder:
```
Expand All @@ -45,6 +45,16 @@ The easiest way to test your changes is to use Storybook, which can be run via:
npm run storybook
```

## Vite-specific caveats
The `vite.config.ts` file in the `@aehrc/smart-forms-renderer` package contains a `resolve: { preserveSymlinks: true }` config, when used alongside `optimizeDeps` and `build.commonjsOptions` allows Vite to use CommonJS modules in the package properly.

This config is essential for the package to properly build in deployments, but it breaks `tsc --watch` by ignoring changes.
To work around this, comment out the config during development and uncomment it (or just don't add it to git) before pushing changes.
```
...
// resolve: { preserveSymlinks: true }
...
```

### Coding conventions

Expand Down

0 comments on commit 06bcf49

Please sign in to comment.