Giter Site home page Giter Site logo

Comments (4)

eventualbuddha avatar eventualbuddha commented on August 19, 2024

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.

mcMickJuice avatar mcMickJuice commented on August 19, 2024

jest is awesome. I'll create a POC branch with highlights of why jest is so dope.

from codemod.

eventualbuddha avatar eventualbuddha commented on August 19, 2024

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.

eventualbuddha avatar eventualbuddha commented on August 19, 2024

Closing for now. It would be nice to get Jest working but it's not a high priority.

from codemod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.