Coder Social home page Coder Social logo

No tests? about react-select HOT 12 CLOSED

jedwatson avatar jedwatson commented on April 28, 2024
No tests?

from react-select.

Comments (12)

ryanzec avatar ryanzec commented on April 28, 2024

That is the first thing that I noticed. A component as complex as this without tests is just asking for trouble.

from react-select.

binarykitchen avatar binarykitchen commented on April 28, 2024

Yep ... I am already having trouble running Jest tests with a Rect component I own which is including react-select within :(

from react-select.

ryanzec avatar ryanzec commented on April 28, 2024

I can actually understand some things not having unit tests depending on the unit test setup. I use Mocha/Chai/JSDom to unit test my code and I can't unit test any visual based stuff but this component definitely has a lot of none-visual stuff that can be unit tested.

from react-select.

binarykitchen avatar binarykitchen commented on April 28, 2024

You can unit-test visual based React stuff with Jest very well!
http://facebook.github.io/jest/docs/tutorial-react.html

And the visual based stuff you are referring to, are mostly called end to end tests (aka E2E). Just run a standalone selenium server in a gulp task, then run a middleware server and at last have a Jasmine test runner. It works well for my other projects.

All I am saying here is that having no tests is not good. I do not like the idea to ship code without enough test coverage, especially for enterprise apps we are developing here.

from react-select.

JedWatson avatar JedWatson commented on April 28, 2024

I would really appreciate help implementing tests for this component.

I have a set of manual processes that I run through to test the component before every release (based on the example configurations), it would certainly take less work to merge PRs and manage releases if our tests were automated.

@binarykitchen you mention having this setup in place for other projects - can you help get them set up here as well?

Also @ryanzec is correct, there are several things that are non-visual and could easily be unit tested.

from react-select.

binarykitchen avatar binarykitchen commented on April 28, 2024

@JedWatson Use the gulp-jest plugin for unit tests. Works like a charm.

from react-select.

JedWatson avatar JedWatson commented on April 28, 2024

@binarykitchen I probably wasn't clear - I'm managing a heap of open source projects at the moment between React stuff, KeystoneJS and TouchstoneJS as well as a having a full time job.

If someone else is able to contribute unit tests for this component I would really appreciate it, otherwise I'll get to them when I can :)

from react-select.

binarykitchen avatar binarykitchen commented on April 28, 2024

fair enough - it is just the fact that code without test is never good. always enforce yourself never to ship code without test ;)

from react-select.

mattdell avatar mattdell commented on April 28, 2024

I've added Jest framework into react-select. Pending PR. #107

from react-select.

JedWatson avatar JedWatson commented on April 28, 2024

Basic tests are in - more to come.

from react-select.

binarykitchen avatar binarykitchen commented on April 28, 2024

good, way to go

from react-select.

dcousens avatar dcousens commented on April 28, 2024

Always could use improvement. This issue isn't really quantifiable beyond a test count being > 1, so I'm closing.
@JedWatson if a given coverage requirement is wanted, lets set that up as a new issue.

from react-select.

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.