Giter Club home page Giter Club logo

Comments (5)

giuseppeg avatar giuseppeg commented on July 28, 2024

Worth adding a test for JSX partials like the following:

class Test extend PureComponent {
   renderItem(item) {
      return <li key={item.id}>{item.value}</li>
   }
   render() {
      return <ul>{this.props.items.map(this.renderItem)}</ul>
   }
}

Maybe it already works?

from styled-jsx.

adamyonk avatar adamyonk commented on July 28, 2024

If you could document a bit how you set up the fixtures and run tests in this project, I'd be happy to write some tests for this stuff!

from styled-jsx.

rauchg avatar rauchg commented on July 28, 2024

@giuseppeg I did imagine that situation. It should work, but it's not tested. Obviously has a slight perf impact as it calls inject many times, but that should be ok since we dedupe with an O(1) check

@adamyonk it's simple. Create two files under fixtures/ (one for the expected result and one for the source), and then set up a corresponding test in test/index.js. For more complicated tests like error handling an out file is not needed

from styled-jsx.

adamyonk avatar adamyonk commented on July 28, 2024

OK, great! Thanks for the info. I can start putting something together once I get #12 figured out.

from styled-jsx.

giuseppeg avatar giuseppeg commented on July 28, 2024

created a separate issue for Error handling #128

from styled-jsx.

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.