GithubHelp home page GithubHelp logo

Add Unit Testing about react-hls HOT 18 OPEN

devcshort avatar devcshort commented on June 26, 2024
Add Unit Testing

from react-hls.

Comments (18)

aortiz24 avatar aortiz24 commented on June 26, 2024 1

Jest and Enzyme seem to be the go-to tools for React Unit Testing. Jest will help do all assertions and enzyme will help render React components in testing mode.

The link below explains the two tools and gives example code.
https://itnext.io/how-to-unit-test-in-react-72e911e2b8d

@devcshort, what are your specific goals regarding the unit testing issue?
I am new to unit testing :)

from react-hls.

aortiz24 avatar aortiz24 commented on June 26, 2024

This would be my first Hacktoberfest issue! I'll look into React Unit Testing if you'll assign me the issue.

from react-hls.

devcshort avatar devcshort commented on June 26, 2024

That would be great @aortiz24 ! 🙂

from react-hls.

devcshort avatar devcshort commented on June 26, 2024

@aortiz24 I'm actually new to unit testing as well. Ideally, I'd like to have automated testing of the react-hls-player component with several different scenarios. I don't want to accidentally push changes that break the entire package when deployed. At some point once CI/CD is set up, would like to have the tests run and then automatically deploy the package.

from react-hls.

aortiz24 avatar aortiz24 commented on June 26, 2024

@devcshort, if you create another issue for CI/CD setup and assign me to that issue. I'll help with CI/CD setup. I've found a medium article that guides through the process: https://medium.com/bettercode/how-to-build-a-modern-ci-cd-pipeline-5faa01891a5b

from react-hls.

devcshort avatar devcshort commented on June 26, 2024

@aortiz24 unfortunately I have someone assigned to CI/CD already :(

from react-hls.

aortiz24 avatar aortiz24 commented on June 26, 2024

I'm going to do some more investigating! @devcshort, What would those different scenarios be in regards to the automated testing of the react-hls-player component? It will help me in my research :)

from react-hls.

aortiz24 avatar aortiz24 commented on June 26, 2024

Hey @devcshort , I have confirmed from multiple sources that Jest and Enzyme are the go-to tools for React Unit Testing! Cypress is used for everything else :)

from react-hls.

devcshort avatar devcshort commented on June 26, 2024

Hi @aortiz24 sorry for not getting back to you sooner, was a busy day yesterday evening! Yes, I believe Jest and Enzyme would be the best and easiest to use for now. May look in to Cypress at a later point.

from react-hls.

aortiz24 avatar aortiz24 commented on June 26, 2024

No worries @devcshort! I did some more research and found that Jest alone can do the unit testing. This is a short & sweet 12 minute breakdown (11:07 - 23:09) of unit testing here: https://www.youtube.com/watch?v=r9HdJ8P6GQI The video is for people who are new to unit testing!

from react-hls.

aortiz24 avatar aortiz24 commented on June 26, 2024

Do you have a util.js? If not, I can make one with your guidance on what you would like unit tested.

Would you like me to make a util.test.js?

from react-hls.

devcshort avatar devcshort commented on June 26, 2024

I don't currently have one, if you'd like to make one, that'd be great :)

from react-hls.

aortiz24 avatar aortiz24 commented on June 26, 2024

Okay, sounds good.

Could you share with me your util.js file where you have written the functions you want unit tested.

Based on that util.js file, I can write the util.test.js file.

from react-hls.

devcshort avatar devcshort commented on June 26, 2024

I don't have a util.js file. I believe the only thing we need to test is the main video component to make sure it renders using commonly used props.

from react-hls.

aortiz24 avatar aortiz24 commented on June 26, 2024

Hey @devcshort, I've learned a lot by trying to work on this issue, but I can no longer devote the time to it. Best of luck!

from react-hls.

osmarpetry avatar osmarpetry commented on June 26, 2024

Anyone already is on this task? If yes, let talk about @testing-library? If not, I will try something with it

from react-hls.

devcshort avatar devcshort commented on June 26, 2024

@osmarpetry the last person wasn't able to continue on this, but if you'd like to give it a try then that'd be great. I'm not familiar with testing so if you have any ideas, I'm all ears

from react-hls.

gnatal avatar gnatal commented on June 26, 2024

Hi I found out a fix can I do a PR ??

from react-hls.

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.