- 2.6.9 Oct.18.2024
- added --glob option for rimraf usage removing un-used sources
- added node v23 to test matrix
- resolve v23-related error when
module.exports
is exported
- 2.6.8 Oct.17.2024
- added pnpm unit-test, thanks @darcyrush
- resolve issue for pnpm by escaping '+' char in regexp
- add log utility function for debugging loader
- dropped ava and jest from test sequence, node v22 --loader issues
- 2.6.7 Jul.16.2024
- add swc tests and remove swc caution from README thanks @Brooooooklyn
- unpin node 22.1 at test CI and use latest 22.x
- 2.6.6 Jun.15.2024
- add tsx tests and remove tsx caution from README thanks @galexite
- pin node 22.1 at test CI and ignore regressions in new node 22
- migrate to eslint 9
- 2.6.5 Apr.25.2024
- add node 22 to ci test pipeline thanks @aladdin-add
- use json import syntax
with { type: 'json' }
for node 22 - skip node 22 tests on windows-latest ci, where node 22 is in a broken state, see nodejs/node#52682
- 2.6.4 Feb.26.2024
- update README with notice about incompatible typescript loaders
- increment resolvewithplus to support more export patterns, see resolvewithplus v2.1.5
- update publish spec job actions, use checkout@v4 and setup-node@v4
- remove node 16 from test job matrix, eol 2023, Sep 11 #254
- 2.6.3 Jan.23.2024
- resolve nested exports defined on named-properties with wildcards, eg
exports: { './*': { default: './src/*/index.js' } }
resolves this issue at esmock
- resolve nested exports defined on named-properties with wildcards, eg
- 2.6.2 Jan.14.2024
- remove reserved keywords from export names lists, allows express to be mocked, thanks @lcapel
- 2.6.1 Jan.13.2024
- update ci job to use checkout v4
- update README to work w/ eslint-plugin-markdown
- update eslint disallow trailing whitespace
- add typescript example to README
- update esmock to correctly mock builtins imported with
await import
thanks @btakita - move typescript example from README to wiki
- update eslint package to resolve failing lint command
- 2.6.0 Nov.07.2023
- typings: make MockFunction generic, thanks @uwinkelvos
- 2.5.9 Nov.01.2023
- mock Array-type default export, thanks @altearius
- support json import mocking, only working at node v21, see node#49724
- 2.5.8 Oct.23.2023
- catch yarn PnP exceptions @koshic
- 2.5.7 Oct.20.2023
- add node 21 to test pipeline
- use latest node 18 at test pipeline
- update resolver again resolves this issue.
- 2.5.6 Oct.15.2023
- update resolver to latest version, resolves a resolution error that seems to have been introduced by a previous update from the past week.
- 2.5.5 Oct.14.2023
- support yarn PnP @koshic
- 2.5.4 Oct.13.2023
- remove condition to not-call resolver with builtin moduleId
- 2.5.3 Oct.12.2023
- update resolver to latest version, slightly faster with fewer loops
- add support for resolver configuration option
- 2.5.2 Oct.06.2023
- update resolver to improve module resolution. See resolvewithplus tags v2.0.6 and v2.0.7.
- resolve "exports" before "main". The spec says: the "exports" field takes precedence over "main" in supported versions of Node.js. The updated resolver correctly returns "main" before "exports" (older resolver did not).
- use package.json "type" to return "import" or "require". The older resolver did not read package.json type and returned incorrect "require" values for some packages. For example, if this inferno package where changed to use type "module", the older resolver would return "index.js" rather than "index.esm.js"
- 2.5.1 Sep.13.2023
- resolve existing ".ts" files, rather than ".js" files, when typescript detected, thanks @tpluscode
- 2.5.0 Sep.09.2023
- 2.4.1 Sep.07.2023
- detect null AND undefined loader-resolved source defintions
- restore commented-out test affected by un-caught
undefined
source definitions
- 2.4.0 Sep.07.2023
- remove esmockDummy
- resolve issues affecting node-v20.6
- remove usage of import.meta.resolve, node-v20.6 meta.resolve is not useful
- only process 'module' and 'commonjs' at the loader
- 2.3.8 Aug.15.2023
- reuse moduleid regexp replacing separately created regexps
- remove esmockIsLoader.js export from esmockLoader.js instead
- simplify esmockIsLoader, per review @koshic
- 2.3.7 Aug.15.2023
- normalize package.json url and reduce loc for loader verification
- small adjustments reducing lines of code
- clerical changes to some test folders
- 2.3.6 Aug.07.2023
- resolve global mocking issues when using mixed esm cjs import trees
- 2.3.4 Jul.30.2023
- do not error when mocking commonjs global values, found by @tommy-mitchell
- 2.3.3 Jul.28.2023
- do not error when processing node hashbang scripts from @tommy-mitchell
- add note explaining why tsx does not work
- pin node 18.16.x to ci test matrix, re node !48948
- 2.3.2 Jul.22.2023
- restore ava unit-test process at node20 test pipeline
- investigate problems using tsx from @tommy-mitchell
- reported the issue at the tsx project, where tsx fails import moduleIds with query params
- 2.3.1 Jun.01.2023
- improve README example for mocking global values
- use the word 'global' in the global values mocking example only, to improve clarity (hopefully)
- 2.3.0 May.31.2023
- add initial support for the solution to "globalThis" mocks,
- support injecting definitions into the mock import tree,
- demonstrate mock setTimeout, fetch and Date scenarious at unit-tests
- remove node 19 test job, update remaining jobs to use node 20
- 2.2.3 May.16.2023
- add node v21 nightly to test ci pipeline
- send wide uri definitions to loader using loader worker
- encountered upstream error when attempting to add node v20 tests
- 2.2.2 May.06.2023
- detect async import.meta.resolve and handle in a separate way
- remove un-necessary usage of await keyword in README example
- require node version less than 20.x
- 2.2.1 Apr.03.2023
- use Object.defineProperty to write mock definitions protected on inherited prototype chain
- 2.2.0 Mar.23.2023
- throw error when esmock.strictest is called with empty mock definition, @koshic @Swivelgames
- update jest and jest-light-runner packages at unit-tests, @koshic
- 2.1.0 Nov.29.2022
- add node v19 to ci-test pipeline
- use live default export to populate enumerable properties of mock definition
- 2.0.9 Nov.26.2022
- resolve windows modules with correct drive letter using resolvewithplus patch from @mshima
- 2.0.8 Nov.25.2022
- use live default export in prototype of returned mock definition to resolve class instance mocking
- added CONTRIBUTING.md
- added mocha tests
- 2.0.7 Oct.26.2022
- use export esmock.js, rather than esmockLoader.js, as main package export
- embed resolvewithplus inside esmock, to support yarn PnP, per @koshic
- use loader mechanism to detect presence of esmock loader
- detect and use import.meta.resolve, when defined by host environment
- 2.0.6 Oct.14.2022
- show full path at error message, making it easier to identify an invalid path
- 2.0.5 Oct.05.2022
- add support for esmock.strictest, a more-strict variant of esmock, per @gmahomarf
- use more-descriptive internal-variable "treeId", rather than "esmockKey"
- include .mjs files in eslint filter and lint-fix existing .mjs files
- 2.0.4 Sep.28.2022
- huge simplifications to typescript types file, much smaller, credit @jsejcksn
- added ts linting
- 2.0.3 Sep.24.2022
- simplify esmock.d.ts file, reducing documentation and using shorter param names
- simplify args normalization and drop support for opts.parent
- simplify path-extraction to use one regexp rather than four
- use newer resolvewithplus with better fileurl support
- simplify main esmock.js file, slightly reducing install size
- 2.0.2 Sep.21.2022
- simplifications, slightly reducing install size
- update jest and jest-light-runner versions used in unit-tests
- add jest+ts-node test example, credit @liuxingbaoyu @cspotcode
- 2.0.1 Sep.15.2022
- use newer, smaller resolvewithplus
- use shared moduleId not found error message
- remove lines not covered by tests
- small fixes: fix README json syntax error and test descriptions, rename modulePath to moduleId
- remove a few chars from README
- 2.0.0 Sep.06.2022
- export a 'strict' variant of esmock
- use 'partial' mock behaviour with default export
- updated readme,
- resolve error when partial mocking modules not found on filesystem
- rename option
isPackageNotFoundError
toisModuleNotFoundError
- see the release announcement for details and migration guide
- 1.9.8 Aug.28.2022
- use latest node v18 for ci-tests, a bug in the ava package prevented this
- use latest resolvewithplus and remove many lines of code needed for the older variant
- use one regexp to detect --loader esmock and make unit-testing around this easier
- update the first example in the README to be smaller and more interesting
- support multiple --loader calls, --loader esmock and --loader=esmock. added unit-tests
- update typescript types file to include
parent
andisPackageNotFoundError
options - give credit to @cawa-93 for showing me how to mock specifier that aren't found in the filesystem
- 1.9.7 Aug.25.2022
- support mocking specifiers that aren't found in filesystem, credit @cawa-93
- 1.9.6 Aug.24.2022
- support parent url to facilitate sourcemap usage, 113
- support import subpaths, eg
import: { '#sub': './path.js' }
- drop support for node 12 and remove node 12 ci pipeline
- 1.9.5 Aug.19.2022
- support cjs packges that define main relative directory only
- 1.9.4 Aug.15.2022
- support core modules w/ node: prefix, credit @gmahomarf
- 1.9.3 Aug.13.2022
- corrected esmock.d.ts errors credit @jakebailey
- 1.9.2 Aug.02.2022
- restore exports main, credit @tripodsan
- 1.9.1 Jul.31.2022
- use package.json exports definition, compatible with newest typescript
- add note to README about problems handling some export expressions
- use shields.io npm badge, add "%" to coverage badge, eg "98.8%"
- 1.9.0 Jul.30.2022
- support for modules using stringy exports.import rules
- add live coverage badge to show, for example, 98% coverage
- add linting for README examples
- improve unit-test for mocking non-extansible objects
- improve node-version definition of
isLT1612
per review @aladdin-add - use smaller and specific condition for calling nextResolve at loader
- 1.8.9 Jul.25.2022
- resolve error, do not define default on extensible objects, credit @tripodsan
- 1.8.8 Jul.24.2022
- add node v14 test pipeline, credit @aladdin-add
- resolve node v14 loader-originating runtime error
- 1.8.7 Jul.24.2022
- remove c8 from dependencies, move to devDependencies
- 1.8.6 Jul.24.2022
- adds jest-light-runner example and unit-tests
- 1.8.5 Jul.23.2022
- adds typescript and node-native runner tests for windows CI
- renames esmockLoader.mjs to esmockLoader.js
- adds runner-specific test folders for tests
- removes dependency on old version of form-urlencoded
- adds tsm unit-test and example
- 1.8.4 Jul.21.2022
- minify sources and dependency, ~13kB smaller
- require newest resolvewithplus package, resolving minification error
- move tests to subdirectory and begin organizing them better
- 1.8.2 Jul.19.2022
- improved support for symlinked paths, credit @swivelgames
- 1.8.1 Jul.19.2022
- resolve recursive load hook crash when using esmock with other loader
- add basic typescript support, using ts-node/esm
- add examples and tests showing how to use with ts loader
- 1.8.0 Jul.18.2022
- use strict-mocking behaviour by default, "partial mock" is optional
- 1.7.8 Jul.16.2022
- add tests using the node native test-runner
- update README to use node native test-runner
- 1.7.7 Jul.14.2022
- support node v18.6.0 loader changes, credit @swivelgames
- 1.7.6 Jul.13.2022
- use npx script commands, credit @swivelgames
- add NODE_OPTIONS support, credit @swivelgames
- 1.7.5 Mar.27.2022
- use async default resolver, returned by node v17.8.0+
- 1.7.4 Feb.15.2022
- increment resolvewithplus to handle stringy esm export, used by 'got'
- 1.7.3 Feb.02.2022
- increment resolvewithplus to handle array esm export, used by 'yargs'
- 1.7.2 Dec.15.2021
- remove README at npm package
- 1.7.1 Dec.15.2021
- increment resolvewithplus, better tests
- 1.7.0 Dec.13.2021
- re-use predefined regexps (faster)
- resolve encoded whitespace bug at module loader
- 1.6.5 Dec.06.2021
- add size and downloads badges to README
- edits to README
- 1.6.3 Dec.04.2021
- adds more examples to README
- 1.6.2 Dec.04.2021
- adds uvu tests and example command to README
- 1.6.1 Dec.03.2021
- adds test verifying deep stacktrace has small path file:///
- resolve bug: '--loader=esmock' not-found error not thrown
- small README edits, update link to wiki (use Home as default)
- 1.6.0 Dec.02.2021
- reduce file url length (improve readability of stacktrace)
- 1.5.0 Dec.01.2021
- resolve bug around error '--loader=esmock' detection
- 1.4.0 Nov.30.2021
- throw error if esmock is called without --loader=esmock
- 1.3.3 Nov.28.2021
- update quick-start README to include phrase 'unit test'
- 1.3.2 Nov.27.2021
- use quick-start README with link to more descriptive README
- 1.3.1 Nov.26.2021
- add npm keywords, remove lines of code
- 1.3.0 Nov.26.2021
- add support for await import, update README
- 1.1.0 Nov.25.2021
- add windows-latest to testing pipeline and begin windows support
- removed files and functions no longer needed
- increment resolvewithplus package and other dependencies
- 1.0.1 Nov.02.2021
- add node v17.x to testing pipeline
- add, make warning message go away for node 16.12.0+
- 1.0.0 Oct.27.2021
- release version 1.0
- 0.4.2 Oct.27.2021
- export 'load' hook from moduleLoader, required by node v16.12.0+
- 0.4.1 Oct.10.2021
- version bump, increment devDependencies,
- major improvement to README, thanks @swivelgames
- 0.4.0 Sep.07.2021
- do not runtime error when returning type '[object Module]' default
- 0.3.9 May.05.2021
- small change to README
- added a test, update gitlab action to use node 16.x
- 0.3.8 Apr.21.2021
- small change to README
- 0.3.7 Apr.20.2021
- add test, throw error if mocked module path is not found
- 0.3.6 Apr.19.2021
- throw error if mocked module path is not found
- 0.3.5 Apr.18.2021
- added gitlab actions npm test: node 12.x, 14.x and 15.x
- 0.3.3 Apr.13.2021
- added keywords to package.json, use github action to npm publish
- 0.3.1 Apr.12.2021
- simplify README
- 0.3.0 Apr.10.2021
- adds support for mocking modules 'globally' for the instance
- 0.2.0 Apr.10.2021
- adds support for mocking core modules such as fs and path
- 0.1.0 Apr.10.2021
- adds support for native esm modules