Skip to content

Commit

Permalink
Merge pull request #181 from iambumblehead/embed-resolvewithplus
Browse files Browse the repository at this point in the history
embed resolvewithplus
  • Loading branch information
iambumblehead committed Oct 25, 2022
2 parents 7e6709a + 7776862 commit d271dfd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# changelog

* 2.0.7 _Oct.??.2022_
* 2.0.7 _Oct.20.2022_
* [embed resolvewithplus inside esmock,](https://github.com/iambumblehead/esmock/pull/181) to support yarn PnP, per @koshic
* [use loader mechanism to detect](https://github.com/iambumblehead/esmock/pull/180) presence of esmock loader
* [detect and use import.meta.resolve,](https://github.com/iambumblehead/esmock/pull/179) when defined by host environment
* 2.0.6 _Oct.14.2022_
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "esmock",
"type": "module",
"version": "2.0.6",
"version": "2.0.7",
"license": "ISC",
"readmeFilename": "README.md",
"description": "provides native ESM import mocking for unit tests",
Expand Down Expand Up @@ -75,7 +75,7 @@
"test-cover": "npm run test:install && c8 npm run test:all",
"lint": "eslint --ext=.js,.mjs .",
"lint-fix": "eslint --ext=.js,.mjs --fix .",
"mini:pkg": "npm pkg delete scripts devDependencies",
"mini:pkg": "npm pkg delete scripts devDependencies dependencies",
"prepublishOnly": "npm run lint && npm run test-ci && npm run mini:pkg"
}
}
5 changes: 3 additions & 2 deletions src/esmockCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const esmockTreeIdGet = key => (
global.mockKeys[String(key)])

const esmockCacheSet = (key, mockDef) => (
esmockCache.mockDefs[key] = mockDef)
global.esmockCache.mockDefs[key] = mockDef)

const esmockCacheGet = key => (
esmockCache.mockDefs[key])
global.esmockCache.mockDefs[key])

const esmockCacheResolvedPathIsESMGet = mockPathFull => (
esmockCache.isESM[mockPathFull])
Expand All @@ -25,6 +25,7 @@ const esmockCacheResolvedPathIsESMSet = (mockPathFull, isesm) => (
esmockCache.isESM[mockPathFull] = isesm)

Object.assign(global, {
esmockCache,
esmockCacheGet,
esmockTreeIdGet,
mockKeys: {}
Expand Down
4 changes: 1 addition & 3 deletions tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
"babelGeneratedDoubleDefault": "file:./local/babelGeneratedDoubleDefault"
},
"scripts": {
"mini:default": "cd .. && npx esbuild ./src/*js --minify --allow-overwrite --outdir=src",
"mini:win32": "cd .. && cd src && forfiles /m \"*.js\" /c \"cmd /c npx esbuild @file --minify --allow-overwrite --outfile=@file\"",
"mini": "run-script-os",
"mini": "cd .. && cd src && npx esbuild esmockLoader.js --minify --bundle --allow-overwrite --platform=node --format=esm --outfile=esmockLoader.js",
"isnodelt18": "node -e \"+process.versions.node.split('.')[0] < 18 || process.exit(1)\"",
"install:esmock": "cd .. && npm install",
"install:test-ava": "cd tests-ava && npm install",
Expand Down

0 comments on commit d271dfd

Please sign in to comment.