From b5fd9673a99dd74b17a894d3dbfa0d1eabc9e0d3 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 12 Sep 2025 00:05:45 -0700 Subject: [PATCH 1/4] restore ava tests and support --- CHANGELOG.md | 1 + README.md | 2 +- tests/package.json | 2 +- tests/tests-ava/spec/esmock.ava.spec.js | 6 ++++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae43a38a..b719b0c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * 2.7.3 _???.??.2025_ * drop node version [18 and 20 from tests.](https://github.com/iambumblehead/esmock/pull/326) * increment some dependencies [and reduce audit warnings.](https://github.com/iambumblehead/esmock/pull/327) + * restore [ava tests and support](https://github.com/iambumblehead/esmock/pull/328) * 2.7.2 _Sep.01.2025_ * [increment resolvewithplus,](https://github.com/iambumblehead/esmock/pull/325) match [exact export paths,](https://github.com/iambumblehead/resolvewithplus/pull/71) thanks @matz3 * 2.7.1 _Jul.01.2025_ diff --git a/README.md b/README.md index 211580cd..e909987f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ _**Note: For versions of node prior to v20.6.0,** "--loader" command line arguments must be used with `esmock` as demonstrated [in the wiki.][4] Current versions of node do not require "--loader"._ -_**Note: due to --loader issues,** support for `ava` and `jest` are dropped._ +_**Note: due to --loader issues,** support for `jest` is dropped._ `esmock` has the below signature ```js diff --git a/tests/package.json b/tests/package.json index 273a4b1a..576f9c66 100644 --- a/tests/package.json +++ b/tests/package.json @@ -51,7 +51,7 @@ "install:all": "node --version && npm install && npm-run-all install:test*", "test:test-uvu": "cd tests-uvu && npm test", "test:test-mocha": "cd tests-mocha && npm test", - "test-dropped:test-ava": "cd tests-ava && npm test", + "test:test-ava": "cd tests-ava && npm test", "test:test-tsx": "cd tests-tsx && npm test", "test-dropped:test-swc": "cd tests-swc && npm test", "test:node19-tsm": " cd tests-tsm && npm test", diff --git a/tests/tests-ava/spec/esmock.ava.spec.js b/tests/tests-ava/spec/esmock.ava.spec.js index 5ae1cf64..b78aa7f3 100644 --- a/tests/tests-ava/spec/esmock.ava.spec.js +++ b/tests/tests-ava/spec/esmock.ava.spec.js @@ -366,8 +366,10 @@ test('should have small querystring in stacktrace filename, deep2', async t => { causeDeepErrorParent() } catch (e) { // newer versions auto-strip querystring from subsequent paths - if (' 18. 2' < process.versions.node.split('.') - .slice(0, 2).map(s => s.padStart(3)).join('.')) { + const [major, minor] = process.versions.node + .split('.').map(it => +it) + const isLT1812 = major < 18 || (major === 18 && minor < 2) + if (isLT1812) { t.true( e.stack.split('\n') .every(line => !line.includes('?') || /\?esmk=\d/.test(line))) From 833c3c94758f8e3836ff0210c0e19cc6f1285670 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 12 Sep 2025 00:08:47 -0700 Subject: [PATCH 2/4] restore swc tests --- CHANGELOG.md | 2 +- tests/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b719b0c0..4c676625 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ * 2.7.3 _???.??.2025_ * drop node version [18 and 20 from tests.](https://github.com/iambumblehead/esmock/pull/326) * increment some dependencies [and reduce audit warnings.](https://github.com/iambumblehead/esmock/pull/327) - * restore [ava tests and support](https://github.com/iambumblehead/esmock/pull/328) + * restore [ava and swc tests and support](https://github.com/iambumblehead/esmock/pull/328) * 2.7.2 _Sep.01.2025_ * [increment resolvewithplus,](https://github.com/iambumblehead/esmock/pull/325) match [exact export paths,](https://github.com/iambumblehead/resolvewithplus/pull/71) thanks @matz3 * 2.7.1 _Jul.01.2025_ diff --git a/tests/package.json b/tests/package.json index 576f9c66..7a05ff10 100644 --- a/tests/package.json +++ b/tests/package.json @@ -53,7 +53,7 @@ "test:test-mocha": "cd tests-mocha && npm test", "test:test-ava": "cd tests-ava && npm test", "test:test-tsx": "cd tests-tsx && npm test", - "test-dropped:test-swc": "cd tests-swc && npm test", + "test:test-swc": "cd tests-swc && npm test", "test:node19-tsm": " cd tests-tsm && npm test", "test:node18-test-tsm": "npm run isnodenight || npm run test:node19-tsm", "test:node18-test-tsx": "cd tests-tsx && npm run test", From 52a0a71606e33ddc6ef8d4c2b4289ce0a39411f3 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 12 Sep 2025 00:17:52 -0700 Subject: [PATCH 3/4] enable all tests, remove check for node18 --- CHANGELOG.md | 2 +- README.md | 2 -- tests/package.json | 21 +++++++++------------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c676625..a419014b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ * 2.7.3 _???.??.2025_ * drop node version [18 and 20 from tests.](https://github.com/iambumblehead/esmock/pull/326) * increment some dependencies [and reduce audit warnings.](https://github.com/iambumblehead/esmock/pull/327) - * restore [ava and swc tests and support](https://github.com/iambumblehead/esmock/pull/328) + * restore [ava and all other disabled test-runner tests](https://github.com/iambumblehead/esmock/pull/328) * 2.7.2 _Sep.01.2025_ * [increment resolvewithplus,](https://github.com/iambumblehead/esmock/pull/325) match [exact export paths,](https://github.com/iambumblehead/resolvewithplus/pull/71) thanks @matz3 * 2.7.1 _Jul.01.2025_ diff --git a/README.md b/README.md index e909987f..6d929076 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ _**Note: For versions of node prior to v20.6.0,** "--loader" command line arguments must be used with `esmock` as demonstrated [in the wiki.][4] Current versions of node do not require "--loader"._ -_**Note: due to --loader issues,** support for `jest` is dropped._ - `esmock` has the below signature ```js await esmock( diff --git a/tests/package.json b/tests/package.json index 7a05ff10..c74f5633 100644 --- a/tests/package.json +++ b/tests/package.json @@ -54,18 +54,15 @@ "test:test-ava": "cd tests-ava && npm test", "test:test-tsx": "cd tests-tsx && npm test", "test:test-swc": "cd tests-swc && npm test", - "test:node19-tsm": " cd tests-tsm && npm test", - "test:node18-test-tsm": "npm run isnodenight || npm run test:node19-tsm", - "test:node18-test-tsx": "cd tests-tsx && npm run test", - "test:node18-test-node": "cd tests-node && npm test", - "test-dropped:node18-test-jest": "cd tests-jest && npm test", - "test-dropped:node18-test-jest-ts": "cd tests-jest-ts && npm test", - "test:node18-test-nodets": "cd tests-nodets && npm test", - "test-dropped:node18-test-source-map": "cd tests-source-map && npm test", - "test:node18-test-no-loader": "cd tests-no-loader && npm test", - "test:node18-test-workspaces": "cd tests-workspaces && npm test", - "test:node18:all": "npm run isnodelt18 || npm-run-all test:node18-test*", - "test:all": "npm-run-all test:test* && npm run test:node18:all", + "test:test-tsm": "cd tests-tsm && npm test", + "test:test-node": "cd tests-node && npm test", + "test:test-jest": "cd tests-jest && npm test", + "test:test-jest-ts": "cd tests-jest-ts && npm test", + "test:test-nodets": "cd tests-nodets && npm test", + "test:test-source-map": "cd tests-source-map && npm test", + "test:test-no-loader": "cd tests-no-loader && npm test", + "test:test-workspaces": "cd tests-workspaces && npm test", + "test:all": "npm-run-all test:test*", "test:all-cover": "c8 --src=../src/* npm run test:all", "test:all-ci": "npm run mini && npm run test:all" } From b1a66ad8ec777fe1e22d110750fdb954a8f3e9cb Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 12 Sep 2025 00:18:55 -0700 Subject: [PATCH 4/4] update CHANGELOG and package version --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a419014b..4c80870b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # changelog - * 2.7.3 _???.??.2025_ + * 2.7.3 _Sep.12.2025_ * drop node version [18 and 20 from tests.](https://github.com/iambumblehead/esmock/pull/326) * increment some dependencies [and reduce audit warnings.](https://github.com/iambumblehead/esmock/pull/327) * restore [ava and all other disabled test-runner tests](https://github.com/iambumblehead/esmock/pull/328) diff --git a/package.json b/package.json index e776154e..365cfb75 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "esmock", "type": "module", - "version": "2.7.2", + "version": "2.7.3", "license": "ISC", "readmeFilename": "README.md", "description": "provides native ESM import and globals mocking for unit tests",