Giter VIP home page Giter VIP logo

Comments (6)

newtriks avatar newtriks commented on July 21, 2024

I am currently reviewing testing and should hopefully have some optimisations soon...

from generator-react-webpack.

ColCh avatar ColCh commented on July 21, 2024

karma-webpack and karma itself are pretty slow and you can't do anything with that.

For my private project, I've replaced karma-webpack and karma with mocha and hacked jsdom into tests - thankfully, React works nice inside of jsdom environment. Tests became pretty fast now!

But, this setup is hacky. I don't found a way to inject jsdom inside of mocha test via --require mocha's flag, so ..., every test has header like require('inject-jsdom.js')

from generator-react-webpack.

weblogixx avatar weblogixx commented on July 21, 2024

I also think that it would be a good idea to make the unit test framework a bit more "pluggable", maybe configurable when setting up new projects?

from generator-react-webpack.

apellizzn avatar apellizzn commented on July 21, 2024

+1

from generator-react-webpack.

weblogixx avatar weblogixx commented on July 21, 2024

With the current react release, it is possible to run tests faster by using shallow rendering (@see http://simonsmith.io/unit-testing-react-components-without-a-dom/). This goes without using jsdom.

I will try to find out if this is a suitable change for the generator and provide a feature branch for it soon.
Would be nice if we could have fast tests :).

from generator-react-webpack.

renanvalentin avatar renanvalentin commented on July 21, 2024

Hey guys,

Using this settings for karma make the tests pretty fast:
https://github.com/webpack/karma-webpack#alternative-usage

Thanks!

from generator-react-webpack.

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.