Comments (4)
I’ve used prettier before and would be happy to have it in this project. I’ve never really used jest before, but would be interested in hearing what that’s like.
from codemod.
jest is awesome. I'll create a POC branch with highlights of why jest is so dope.
from codemod.
I made a branch with a work in progress conversion to jest. Overall I like it, but I think the require
clobbering may interfere with the require
clobbering that codemod does. I get this:
FAIL src/__tests__/CLI.test.ts
● CLI › can load plugins written with ES modules by default
/Users/donovan/src/babel-codemod/test/fixtures/plugin/increment-export-default.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export default function() {
^^^^^^
SyntaxError: Unexpected token export
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:318:17)
at PluginLoader.<anonymous> (src/PluginLoader.ts:20:28)
at fulfilled (src/PluginLoader.ts:4:56)
● CLI › can load plugins with multiple files with ES modules by default`
/Users/donovan/src/babel-codemod/test/fixtures/plugin/increment-export-default-multiple/increment-export-default.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import incrementValue from './increment-value'
^^^^^^
SyntaxError: Unexpected token import
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:318:17)
at PluginLoader.<anonymous> (src/PluginLoader.ts:20:28)
at fulfilled (src/PluginLoader.ts:4:56)
● CLI › fails when specifying --find-babel-config as there are no plugins loaded
AssertionError [ERR_ASSERTION]: error should reference invalid syntax: TypeError: rawPlugin is not a function
27 | readonly resolvedPath?: string
28 | ) {
> 29 | let instance = rawPlugin(Babel);
30 |
31 | if (instance.name) {
32 | this.declaredName = instance.name;
at new Plugin (src/Options.ts:29:20)
at Options.<anonymous> (src/Options.ts:72:18)
at fulfilled (src/Options.ts:4:56)
at Object.<anonymous> (src/__tests__/CLI.test.ts:249:7)
at Generator.throw (<anonymous>)
at rejected (src/__tests__/CLI.test.ts:5:63)
● CLI › can load and run with a remote plugin
/private/var/folders/23/gjsrxxg57v5fqwmcsk2_57b80000gn/T/tmp-3602WX7D0eoNUHaE.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export default function() {
^^^^^^
SyntaxError: Unexpected token export
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:318:17)
at PluginLoader.<anonymous> (src/PluginLoader.ts:20:28)
at fulfilled (src/PluginLoader.ts:4:56)
PASS src/__tests__/Options.test.ts
PASS src/resolvers/__tests__/FileSystemResolver.test.ts
PASS src/__tests__/TransformRunner.test.ts
PASS src/resolvers/__tests__/AstExplorerResolver.test.ts
PASS src/resolvers/__tests__/NetworkResolver.test.ts
PASS src/__tests__/ProcessSnapshot.test.ts
Test Suites: 1 failed, 6 passed, 7 total
Tests: 4 failed, 51 passed, 55 total
Snapshots: 0 total
Time: 1.757s
Ran all test suites.
from codemod.
Closing for now. It would be nice to get Jest working but it's not a high priority.
from codemod.
Related Issues (20)
- The automated release is failing 🚨
- All-or-nothing matches HOT 7
- `and` matches HOT 1
- Difference between codemod-js and jscodeshift HOT 1
- Error: Requires Babel "^7.0.0-beta.41", but was loaded with "7.9.0" HOT 4
- Options are not passed into the plugin HOT 6
- Is there any way to ignore certain paths? HOT 5
- Bug? (babelrc options not work) + Use case (need to pass fn to plugin options) HOT 2
- Suggestion: replace custom file path resolver with globby HOT 5
- Suggestion: use Piscina for faster codemods HOT 1
- ASTExplorer latest revision link does not work with `--remote-plugin` HOT 1
- Debug mode? HOT 1
- [Question] How to create npx compatible codemod runners
- [Question] How to list changed files? HOT 1
- 3.1.0 Breaking Changes? HOT 6
- Adding an onComplete function HOT 1
- .match issues with TypeScript and fromCapture HOT 3
- Decorators cannot be used to decorate parameters. HOT 1
- Run with a custom babel.config.js HOT 1
- combine spacers and matchers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codemod.