Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests #13

Closed
ElliotFriend opened this issue Sep 24, 2024 · 11 comments · Fixed by #29
Closed

Add unit tests #13

ElliotFriend opened this issue Sep 24, 2024 · 11 comments · Fixed by #29
Assignees
Labels
ODHack8 Issues eligible for the OnlyDust hackathon

Comments

@ElliotFriend
Copy link
Contributor

ElliotFriend commented Sep 24, 2024

This project has no tests written for it. That should be rectified. When creating a new SvelteKit project, you can optionally create structure for integration tests using playwright or unit tests using vitest. So, those seem like decent options for us to use here.

Unit tests should be written for probably all the functions we have written in /src/lib/stellar/* and /src/lib/utils.js, but there might be more places where that's appropriate, as well.

@ElliotFriend ElliotFriend added ODHack8 Issues eligible for the OnlyDust hackathon good first issue Good for newcomers and removed good first issue Good for newcomers labels Sep 25, 2024
@ElliotFriend ElliotFriend changed the title Add unit and/or integration tests Add unit tests Sep 25, 2024
@martinvibes
Copy link

can i work on this @ElliotFriend

Copy link

onlydustapp bot commented Sep 25, 2024

Hi @martinvibes!
Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust.
Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

@jimenezz22
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am an active member of the Dojo Coding community in Costa Rica, with experience in Cairo, having built onchain games like ByteBeasts and contributed to open-source projects such as CairoLint, where I implemented tests for Cairo lints. Additionally, I taught Cairo during the Starknet Bootcamp for Dojo Coding. I also have experience with TypeScript, contributing to Starknet Quest by developing components like ComboBoxes, among others.

How I plan on tackling this issue

Approach for the Issue:

Set Up Unit Testing Framework:

I will review all the functions located in /src/lib/stellar/* and /src/lib/utils.js to identify the critical areas that require unit tests. Additional functions across the codebase will also be evaluated to ensure comprehensive test coverage.
Write Unit Tests:

For each function, I will write unit tests that cover:
Success Cases: Ensure that each function behaves as expected with valid inputs.
Edge Cases: Identify and write tests for potential edge cases or boundary conditions.
Error Handling: Test how each function handles invalid inputs or exceptions.
Mocking and Dependencies:

Where necessary, I will mock external dependencies or API calls to isolate the behavior of individual functions during testing.
Run and Validate Tests:

I will ensure that all tests run successfully, verifying that each function performs as expected and that the codebase is now covered with unit tests.
Estimated Time to Completion: 2-3 days, depending on the number of functions and complexity.

@gregemax
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

"Experienced in JavaScript with a focus on Vitest and Playwright for testing. I've writing tests to ensure code quality and reliability

How I plan on tackling this issue

I would set up Vitest for unit tests and Playwright for integration tests, focusing first on key functions in /src/lib/stellar/* and /src/lib/utils.js. Then, I’d ensure comprehensive coverage by gradually expanding tests across the project.

@mariocodecr
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hii! My name is Mario Araya, I’m a Software Developer with 2+ years of experience. I have worked with backend technologies such as Cairo, Java, and C#, as well as frontend development using React, NextJS, and JavaScript/TypeScript. I’ve made contributions to open-source projects, completed a Starknet Bootcamp, exercises on NodeGuardians, finished Starklings, and participated in multiple hackathons. I’m also a member of the Dojo Coding community here in Costa Rica.

How I plan on tackling this issue

I would approach this issue by first setting up either Playwright for integration tests or Vitest for unit tests, as these frameworks will provide a solid foundation for testing. I would identify all functions in /src/lib/stellar/* and /src/lib/utils.js to write comprehensive unit tests, ensuring to cover normal cases, edge cases, and error handling. Additionally, I would review other areas in the codebase for potential testing opportunities, such as complex components or services. After implementing the tests, I would run them to ensure they pass and check for coverage reports to identify untested areas. If necessary, I would also integrate Playwright for broader integration testing to ensure overall application functionality. Throughout this process, I would consult documentation for best practices and seek feedback from maintainers for any improvements.

@Ugo-X
Copy link

Ugo-X commented Sep 26, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a Full Stack blockchain Developer with expertise in Next.js, Nest.js, TypeScript, JavaScript, React, Node.js, Three.js, Solidity and rust. My journey with OnlyDust hackathons began at Edition 1, and I've since made 69 contributions across 14 projects. With my extensive experience on the OnlyDust platform (profile: https://app.onlydust.com/u/Ugo-X), I've honed my skills in delivering quality solutions under pressure.

I bring a unique blend of technical proficiency and user-focused design to every project, whether it's crafting immersive 3D experiences or developing smart contracts. My track record shows I can adapt quickly and contribute effectively to diverse challenges.

As we surf through Edition 8, I'm excited to leverage my skills and hackathon experience to push the boundaries of blockchain development. I'm confident in my ability to tackle new challenges and drive innovation in this space.

How I plan on tackling this issue

I will approach this issue in the following manner:

  1. I will set up Vitest for unit testing:

    a. Install necessary dependencies

    b. Configure Vitest in the project

    c. Create a test structure mirroring the src directory

  2. I will write unit tests for functions in /src/lib/stellar/* and /src/lib/utils.js:

    a. Identify testable functions

    b. Create test files for each module

    c. Write tests covering various scenarios and edge cases

  3. I will set up Playwright for integration testing:

    a. Install Playwright and necessary dependencies

    b. Configure Playwright in the project

    c. Create a basic test structure for components and pages

  4. I will write integration tests for key components and pages:

    a. Identify critical user flows

    b. Create tests simulating user interactions

    c. Verify expected outcomes and state changes

  5. I will implement CI/CD pipeline integration for automated testing.

  6. I will add code coverage reporting to identify areas needing more tests.

@josephchimebuka
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @ElliotFriend I am Joseph I am a Software developer and blockchain developer and I am also an active contributor here on only dust here is my profile https://app.onlydust.com/u/josephchimebuka. This is my first time to contribute to this repo ill appreciate the opportunity to contribute.

How I plan on tackling this issue

To address the lack of tests in the project, I will first set up a testing environment by installing both Playwright for integration tests and Vitest for unit tests. After configuring Playwright for browser-based testing and Vitest for function-level testing in the SvelteKit project, I will create a structured testing folder. Next, I will write unit tests for the core functions located in /src/lib/stellar/* and /src/lib/utils.js to ensure proper functionality. Additionally, I will review the rest of the codebase to identify other critical areas where unit tests are appropriate, ensuring comprehensive test coverage. I will complete this in 2-3 days

@martinvibes
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

hello i am a frontend dev and blockchain developer
please can i work on this issue :) and would love to be a contributor

How I plan on tackling this issue

To solve the add unit tests issue for ODHack8:

Set Up Testing Framework: Choose Vitest for unit tests and set it up in your project.

Identify Functions to Test: Review /src/lib/stellar/* and /src/lib/utils.js to find functions needing tests.

Create Test Files: Create corresponding test files (e.g., functionName.test.js) for each function.

Write Unit Tests: Implement tests covering various scenarios, including edge cases and error handling.

Run Tests: Execute the tests and ensure they pass.

Refactor if Needed: Refactor code for better testability if tests are failing or difficult to write.

Commit Changes: Commit your changes with a clear message about the added tests.

Documentation: Optionally, document the testing process in your project’s README.

@ShantelPeters
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a blockchain developer with a strong background in html, css, javascript , typescript , this would be my first time contributing to this ecosystem . and i would be glad to work on this issue

How I plan on tackling this issue

By setting up unit tests using Vitest for functions in /src/lib/stellar/ and /src/lib/utils.js, and consider other areas where tests are needed. Optionally, use Playwright for integration tests in the SvelteKit project.

@Nemezjusz
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have extensive experience in software testing within the telecom industry, focusing on both manual and automated testing for complex systems.

How I plan on tackling this issue

I would start by auditing the code in /src/lib/stellar/* and /src/lib/utils.js to identify key functions for unit testing. Also i would implement integration tests to simulate user interactions and ensure seamless component integration.

@jimenezz22
Copy link
Contributor

thanks @ElliotFriend for assigning me the issue, I will start working asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ODHack8 Issues eligible for the OnlyDust hackathon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants