Skip to content

Commit b444f95

Browse files
Merge pull request #328 from iambumblehead/restore-ava-tests
restore ava tests and support
2 parents 88a5433 + b1a66ad commit b444f95

File tree

5 files changed

+18
-20
lines changed

5 files changed

+18
-20
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# changelog
22

3-
* 2.7.3 _???.??.2025_
3+
* 2.7.3 _Sep.12.2025_
44
* drop node version [18 and 20 from tests.](https://github.com/iambumblehead/esmock/pull/326)
55
* increment some dependencies [and reduce audit warnings.](https://github.com/iambumblehead/esmock/pull/327)
6+
* restore [ava and all other disabled test-runner tests](https://github.com/iambumblehead/esmock/pull/328)
67
* 2.7.2 _Sep.01.2025_
78
* [increment resolvewithplus,](https://github.com/iambumblehead/esmock/pull/325) match [exact export paths,](https://github.com/iambumblehead/resolvewithplus/pull/71) thanks @matz3
89
* 2.7.1 _Jul.01.2025_

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
_**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"._
1515

16-
_**Note: due to --loader issues,** support for `ava` and `jest` are dropped._
17-
1816
`esmock` has the below signature
1917
```js
2018
await esmock(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "esmock",
33
"type": "module",
4-
"version": "2.7.2",
4+
"version": "2.7.3",
55
"license": "ISC",
66
"readmeFilename": "README.md",
77
"description": "provides native ESM import and globals mocking for unit tests",

tests/package.json

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,18 @@
5151
"install:all": "node --version && npm install && npm-run-all install:test*",
5252
"test:test-uvu": "cd tests-uvu && npm test",
5353
"test:test-mocha": "cd tests-mocha && npm test",
54-
"test-dropped:test-ava": "cd tests-ava && npm test",
54+
"test:test-ava": "cd tests-ava && npm test",
5555
"test:test-tsx": "cd tests-tsx && npm test",
56-
"test-dropped:test-swc": "cd tests-swc && npm test",
57-
"test:node19-tsm": " cd tests-tsm && npm test",
58-
"test:node18-test-tsm": "npm run isnodenight || npm run test:node19-tsm",
59-
"test:node18-test-tsx": "cd tests-tsx && npm run test",
60-
"test:node18-test-node": "cd tests-node && npm test",
61-
"test-dropped:node18-test-jest": "cd tests-jest && npm test",
62-
"test-dropped:node18-test-jest-ts": "cd tests-jest-ts && npm test",
63-
"test:node18-test-nodets": "cd tests-nodets && npm test",
64-
"test-dropped:node18-test-source-map": "cd tests-source-map && npm test",
65-
"test:node18-test-no-loader": "cd tests-no-loader && npm test",
66-
"test:node18-test-workspaces": "cd tests-workspaces && npm test",
67-
"test:node18:all": "npm run isnodelt18 || npm-run-all test:node18-test*",
68-
"test:all": "npm-run-all test:test* && npm run test:node18:all",
56+
"test:test-swc": "cd tests-swc && npm test",
57+
"test:test-tsm": "cd tests-tsm && npm test",
58+
"test:test-node": "cd tests-node && npm test",
59+
"test:test-jest": "cd tests-jest && npm test",
60+
"test:test-jest-ts": "cd tests-jest-ts && npm test",
61+
"test:test-nodets": "cd tests-nodets && npm test",
62+
"test:test-source-map": "cd tests-source-map && npm test",
63+
"test:test-no-loader": "cd tests-no-loader && npm test",
64+
"test:test-workspaces": "cd tests-workspaces && npm test",
65+
"test:all": "npm-run-all test:test*",
6966
"test:all-cover": "c8 --src=../src/* npm run test:all",
7067
"test:all-ci": "npm run mini && npm run test:all"
7168
}

tests/tests-ava/spec/esmock.ava.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,10 @@ test('should have small querystring in stacktrace filename, deep2', async t => {
366366
causeDeepErrorParent()
367367
} catch (e) {
368368
// newer versions auto-strip querystring from subsequent paths
369-
if (' 18. 2' < process.versions.node.split('.')
370-
.slice(0, 2).map(s => s.padStart(3)).join('.')) {
369+
const [major, minor] = process.versions.node
370+
.split('.').map(it => +it)
371+
const isLT1812 = major < 18 || (major === 18 && minor < 2)
372+
if (isLT1812) {
371373
t.true(
372374
e.stack.split('\n')
373375
.every(line => !line.includes('?') || /\?esmk=\d/.test(line)))

0 commit comments

Comments
 (0)