Repository navigation
Releases
drop legacy support
From this release, esmock now supports minimum node version 22.15. Changes here are mostly credit to @tommy-mitchell.
Older versions of esmock supported numerous different scenarious as required by legacy versions of nodejs, which added complexity and noise to source code, to bundling operations and to unit-tests. As a result of dropping support for older node versions, esmock's install size is smaller than ever, ~20.5Kb; its CI test-coverage is higher than ever, 100%, its test pipeline finishes sooner and its source code is more readable.
- streamline and update test-suite. remove logic to run "--loader" and non-"--loader" specific tests. remove logic to run or skip tests for specific (older) versions of node. remove logic to run or skip tests depending upon windows or linux environment. remove un-maintained testing-tools from the test suite: ts-node, tsm and uvu. greatly simplifies the tests
- drop support for pre-v20 node --loader behaviour. removal of some code that was un-usual and un-intuitive. removes mention of "--loader" from README.md for slightly smaller README.md,
- drop all support for node v20 and earlier, credit @tommy-mitchell
- publish a single minified file. previous versions published separate loader and loader.deprecated files.
npm publish --dry-runshows smaller package-size @v3.0.0 8.4 kB (was @v2.8.0 10.3 kB), - support simultaneous local and global import mocks. Previously, local and global import mocks sharing the same name would resolve the global variant. credit @tommy-mitchell, thank you
perf improvement
Thank you @ekremney for the terrific improvements featured in this release,
- performance improvement that replaces regexp parsing with (faster) string operations, credit @ekremney
- correctness improvement allows moduleIds with parens in the path to be mocked, eg
app/(marketing)/file.js, credit @ekremney
output esmockLoader.deprecated.js with esbuild
generates esmockLoader.deprecated.js with esbuild on publish, so module is self-contained and doesn't import any missing modules discluded from publish
include esmockLoader.deprecated.js in published sources
This release includes esmockLoader.deprecated.js in the published src directory. Yesterday's release did not include the file and caused some problems
- unpublished version 2.7.7
- include esmockLoader.deprecated.js in published src directory
prefer registerHooks over deprecated register
This release fixes a deprecation warning notice for module.register calls; recommended module.registerHooks is called when the environment defines that.
Actual changes are small. For registerHooks, deprecated module.register functions were copy-pasted and converted to sync from async,
- update github ci actions
- use module.registerHooks when defined, resolves module.register deprecation warning
- increment eslint and lint-related
wildcard-issue resolved
mostly resolves a recently-discovered issue resolving certain wildcard-pattern export keys
- update test-coverage badge to reference "main" branch,
- specify node v24 at build+publish ci-job
- increment eslint and lint-related
- increment resolvewithplus, resolves wildcard-export-related issue. see iambumblehead/resolvewithplus#76 thanks @AdaptivChris
clerical changes; linting+coverage
src files are unchanged; only clerical changes for linting and coverage tools,
- migrate to eslint 10
- migrate to @eslint/markdown
- remove c8 test-coverage package, use node's --test-cover
support typescript-modules
- add support for typescript modules, no tests, thanks @mbrevda,
- add node 25.x to test matrix,
- disable tests using node-ts (seems un-maintained),
- windows tests are disabled for "tests-node", lacking windows env to resolve
restore support for ava and other test runners
restore support for ava and other test runners,
- drop node version 18 and 20 from tests.
- increment some dependencies and reduce audit warnings.
- restore ava and all other disabled test-runner tests
match exact export paths
increment resolvewithplus, match exact export paths, thanks @matz3