GithubHelp home page GithubHelp logo

Comments (6)

adriantoine avatar adriantoine commented on June 28, 2024

Hi @jbrantly!

I am open to any kind of improvements, but I don't think I understand your use cases clearly. Can you provide code examples? As far as I know, if you can do something with Enzyme, you can do it with enzyme-to-json 🤔

Thanks!

from enzyme-to-json.

sboudrias-aa avatar sboudrias-aa commented on June 28, 2024

@adriantoine Hey, I think this would be really useful for people using CSS-in-JS tools. A lot of them are creating a lot of unnecessary noise in the snapshot files.

For example, with styled-jsx:

exports[`<Overlay.Control> click trigger 1`] = `
<div
  className="OverlayControl"
  data-jsx={3299129060}
  onClick={[Function]}
>
  children
  <_class
    css=".OverlayControl[data-jsx=\\"3299129060\\"] {display: inline-block;position: relative;}"
    styleId={4150426368}
  />
  <_class
    css="
                  .OverlayControl .Overlay {
                      display: none;
                  }
              "
    styleId={3597040161}
  />
</div>
`;

Or with glamorous:

exports[`<Button> renders text 1`] = `
<button
  className=""
  data-css-1qmv7zm=""
>
  My Button
</button>
`;

Having less verbose snapshot would certainly be welcomed by a lot of these tools users. Right now they make snapshot a pain to review.

from enzyme-to-json.

adriantoine avatar adriantoine commented on June 28, 2024

@sboudrias-aa it does look like an interesting feature. @jbrantly has started a PR a while ago, I'll see if I can implement it myself.

Thanks for your feedback.

from enzyme-to-json.

adriantoine avatar adriantoine commented on June 28, 2024

Fixed by #56

from enzyme-to-json.

adriantoine avatar adriantoine commented on June 28, 2024

I'm reopening that as it's not really what was implemented in #56, I'll work on a solution for v3.0 (see #67)

from enzyme-to-json.

adriantoine avatar adriantoine commented on June 28, 2024

Ok well I'm closing this again 😁 Just to let you know that the mapping feature will be in 3.0 all the details there: #67 (comment)

from enzyme-to-json.

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.