Skip to content

Commit

Permalink
fix: jest transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Aug 10, 2022
1 parent 3b9954f commit 217a828
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
6 changes: 1 addition & 5 deletions packages/jest-preset/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@4c/jest-preset",
"version": "1.8.0",
"version": "1.7.0",
"main": "index.js",
"repository": {
"type": "git",
Expand All @@ -11,12 +11,8 @@
"license": "MIT",
"dependencies": {
"babel-jest": "^28.1.3",
"find-up": "^5.0.0",
"find-yarn-workspace-root": "^2.0.0"
},
"peerDependencies": {
"jest": "^25.1.0"
},
"devDependencies": {
"jest": "^28.1.3"
}
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-preset/transforms/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const path = require('path');

module.exports = {
process(_, filename) {
return `module.exports = ${JSON.stringify(path.basename(filename))};`;
return {
code: `module.exports = ${JSON.stringify(path.basename(filename))};`,
};
},
};
2 changes: 1 addition & 1 deletion packages/jest-preset/transforms/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
process() {
return 'module.exports = {};';
return { code: 'module.exports = {};' };
},
getCacheKey() {
return 'style-transform';
Expand Down
9 changes: 9 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
text-table "^0.2.0"
yargs "^17.1.1"

"@4c/jest-preset@^1.8.0":
version "1.8.0"
resolved "https://registry.yarnpkg.com/@4c/jest-preset/-/jest-preset-1.8.0.tgz#79e1fa5dfefa642808c6d65ab7908ea4e9394ec6"
integrity sha512-qBrBrbR/YiOleNJErwaMqCP+cw4YGqXF3R+EIgLg/La28sf9fuhCaYjN9OrUBLjKwF6HkdMfPrd7M0iSV9NPHA==
dependencies:
babel-jest "^28.1.3"
find-up "^5.0.0"
find-yarn-workspace-root "^2.0.0"

"@ampproject/remapping@^2.1.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d"
Expand Down

0 comments on commit 217a828

Please sign in to comment.