Skip to content

Commit

Permalink
Re-write resolved filenames regardless of tracing specifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsop-d committed May 6, 2024
1 parent 375d7a5 commit c565e69
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Any import statements within this particular file will not be re-written.
- 0.1.12 Performance increase, tracing prioritization and defensive try/catch ✅
- 0.1.13 Pre-commit lint, format test and github action to test again. ✅
- 0.1.14 Expose ready-made transformer to relief the user from having to pass in the jestConfig object. ✅
- 0.1.15 Performance improvements ✅
- 0.1.16 Ensure all different `jest.mock` calls are properly treated.
- 0.1.17 Expose debugging options to the user (like printing which imports are being rewritten, or the transpiled output of a particular file).
- 0.1.17 Expose a jest reporter to print a high-level overview of what the plugin did within the run (and potientialy report barel file statistics)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gtsopanoglou/babel-jest-boost",
"version": "0.1.14",
"version": "0.1.15",
"description": "Babel plugin to boost jest performance by skipping intermediate imports",
"scripts": {
"format:check": "prettier . --check",
Expand Down
2 changes: 2 additions & 0 deletions package/plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ module.exports = function babelPlugin(babel) {
]);
toRemove.push(index);
}
} else {
path.node.source = babel.types.stringLiteral(importedFrom);
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions spec/import-cases.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ describe("babel-jest-boost plugin import cases", () => {
"import { one, two, target } from './test_tree/library';",
`
import { target } from "${__dirname}/test_tree/library/library.js";
import { one, two } from './test_tree/library';
import { one, two } from "${__dirname}/test_tree/library/index.js";
`,
);
expectTransform(
"import { one, two, target as three } from './test_tree/library';",
`
import { target as three } from "${__dirname}/test_tree/library/library.js";
import { one, two } from './test_tree/library';
import { one, two } from "${__dirname}/test_tree/library/index.js";
`,
);
expectTransform(
Expand Down

0 comments on commit c565e69

Please sign in to comment.