Skip to content

Commit 2b4cc58

Browse files
committed
fix(test): enable Jest ESM for jose on Node 24+
NODE_OPTIONS=--experimental-vm-modules unblocks unit tests when jose is ESM-only; CI also listens on the active `dev` branch.
1 parent ff5b402 commit 2b4cc58

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [ main, develop, dev ]
66
pull_request:
7-
branches: [ main, develop ]
7+
branches: [ main, develop, dev ]
88

99
jobs:
1010
test:

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- Fixed Jest under Node 24+ for ESM-only `jose` by enabling `--experimental-vm-modules` in the test script.
11+
1012
- Switched Rollup to `@rollup/plugin-typescript` so TypeScript builds on CI; regenerated `package-lock.json` for `npm ci`.
1113
- Pinned vulnerable transitive floors (`serialize-javascript`, `minimatch`, `js-yaml`, `brace-expansion`) and upgraded the ESLint toolchain.
14+
- Jest unit tests load CJS `dist` against ESM-only `jose` via `NODE_OPTIONS=--experimental-vm-modules` (Node 20+).
1215

1316
## [1.0.3] - 2026-10-11
1417

‎package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"scripts": {
1515
"build": "rollup -c",
1616
"dev": "rollup -c -w",
17-
"test": "jest",
18-
"test:watch": "jest --watch",
19-
"test:coverage": "jest --coverage",
17+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
18+
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
19+
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
2020
"lint": "eslint src/**/*.js",
2121
"lint:fix": "eslint src/**/*.js --fix",
2222
"format": "prettier --write src/**/*.js"

0 commit comments

Comments
 (0)