Giter VIP home page Giter VIP logo

Comments (10)

knightcube avatar knightcube commented on July 19, 2024 3

@shootermv @NoamGaash I would like to get started working on adding Unit Tests (with Jest) too. I don't have much experience with writing Unit tests. So I guess this project could be a great starting point.

from open-bus-map-search.

amabelleS avatar amabelleS commented on July 19, 2024 1

Hey:)
I don't have much experience with testing, little with jest, some with cypress.
That is why I would love to take this issue. Are there videos Noam posted somewhere on how to do unit tests and e2e?

from open-bus-map-search.

shootermv avatar shootermv commented on July 19, 2024 1

from open-bus-map-search.

amabelleS avatar amabelleS commented on July 19, 2024 1

Noad did very good guide about e2e palywright tests here https://www.youtube.com/watch?v=jEWG7nYKk_0 for creating unit tests for components, i think you better look at react testing library docs https://testing-library.com/docs/react-testing-library/intro

On Wed, Oct 11, 2023 at 9:50 PM Amabelle Trachtenberg < @.> wrote: Hey:) I don't have much experience with testing, little with jest, some with cypress. That is why I would love to take this issue. Are there videos Noam posted somewhere on how to do unit tests and e2e? — Reply to this email directly, view it on GitHub <#107 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKGMHUUMEEW3Y3KZ7R5EADX63S6DANCNFSM6AAAAAA52NLXSY . You are receiving this because you authored the thread.Message ID: @.>
-- http://gs500coder.blogspot.com

Thx for the links:) I'll look into them. You can assign it to me if you like.

from open-bus-map-search.

NoamGaash avatar NoamGaash commented on July 19, 2024 1

@amabelleS what kind of tests will you do? e2e/unit/component?
I'll create a separate issue

from open-bus-map-search.

amabelleS avatar amabelleS commented on July 19, 2024 1

@amabelleS what kind of tests will you do? e2e/unit/component? I'll create a separate issue

all kinds:) we'll start with e2e - #118 :)

from open-bus-map-search.

NoamGaash avatar NoamGaash commented on July 19, 2024

sounds perfect! thank you both
let me know how I can help
@knightcube @amabelleS

from open-bus-map-search.

knightcube avatar knightcube commented on July 19, 2024

@NoamGaash By the way, I am looking for a code coverage tool that can generate code reports. It will help us measure code coverage for our project.

After a bit of debugging, I got to know that we can't use Playwright to create code coverage reports yet. Here is another tool that is helpful to some extent - https://github.com/anishkny/playwright-test-coverage

But I couldn't get it working for our project and hence raised this issue - anishkny/playwright-test-coverage#148

If we used Vitest, it would have been simpler to generate code coverage reports but with Playwright, I guess we just have to wait a bit (sigh!).

Also what if we migrate to Mocha as our testing library instead of Playwright?

Here is a detailed comparison between Mocha and Playwright - https://knapsackpro.com/testing_frameworks/difference_between/mochajs/vs/playwright

from open-bus-map-search.

NoamGaash avatar NoamGaash commented on July 19, 2024

In my opinion, code coverage is a bad metric - the fact every line in the code executed at least once during your test suite has nothing to do with finding bugs and regressions. Maybe it's good for upper management in some companies, where a rough estimation of "code quality" is required from the RND department, but having 100% code coverage is not something we should be looking forward.

I do consider adding visual tests. as Applitools employee, I think we have an open source plan. I'll check that out.

Anyway, the main focus (in my opinion) should be on preventing regression, and reducing the fear factor.
When I review a pull request, I usually won't run it locally at all. I expect the test suit to test the buisiness logic of the application.

For example, I don't think anyone would break the ordering of menu items. If someone will try to change that, it will be very easy to tell that from the code, and reject their contribution.
However, if someone will break one of the maps, and it won't longer contain any bus icons, it would be infeasible to know without cloning their branch, executing the code and manually go over each page of the application.

Therefore, testing the existence of bus icon in every page would provide us more value.

That's my opinion. What do you think?

from open-bus-map-search.

knightcube avatar knightcube commented on July 19, 2024

I strongly appreciate your detailed response. Thanks a bunch!

I agree with your point about the ordering of the menu items.

I would like to work on a better test scenario.

Could you please assign (or create) an issue which I can write tests for?

Happy to work on Unit Tests, Integration tests, or e2e Tests.

from open-bus-map-search.

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.