asgardeo / asgardeo/javascript

chore: add unit test coverage for untested code paths in `@asgardeo/browser`

Ouverte
#166 5 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
@asgardeo/browser Complexity/Medium Type/Improvement Type/Task
Langage dominant
TypeScript
Étoiles
18
Forks
67
Merge moyen
4 h 6 min
PR mergées (30 j)
13

Description

### Current Limitation

Some code paths and edge cases in @asgardeo/browser are not covered by unit tests, leading to reduced confidence in code changes, potential bugs, and lower test coverage.

- Reduced confidence in code changes and refactoring
- Potential undetected bugs in less common scenarios
- Lower overall test coverage metrics
- Increased manual testing effort
- Difficulty in maintaining code quality over time

Without adequate unit tests, the codebase may contain:

- Functions or methods that are not validated for all input variations
- Edge cases that may break silently
- Logic errors that are only caught in integration or production environments

### Suggested Improvement

Identify and add unit tests for untested code paths and edge cases in @asgardeo/browser. Improve test coverage and reliability.

## Implementation Plan

1. Review the latest code coverage to identify untested lines/branches.
2. Select a function, method, or component that lacks test coverage.
3. Write a new unit test that:
- Covers normal, boundary, and invalid input cases
- Asserts correct output and expected error handling
4. Run the test suite to confirm the new test is effective and passes.
5. Update documentation or test coverage badges as necessary.

**References:**
- https://vitest.dev/
- [Improving test coverage](https://blog.codecov.io/how-to-improve-code-coverage-ec7d5c5e1236/)

### Please select the package issue is related to

@asgardeo/browser

### Version

Current

### Reporter Checklist

- [x] I have searched the existing issues and this is not a duplicate.
- [x] I have provided all the necessary information.
- [x] I have verified the improvement is not available in the latest version of the package.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par examiner la couverture la plus récente du package @asgardeo/browser et par exécuter sa suite de tests unitaires existante avec Vitest afin d’identifier les lignes et les branches non testées. Sélectionnez une fonction, une méthode ou un composant spécifique, puis ajoutez des tests pour les entrées normales, limites et invalides ; le travail est terminé lorsque les tests passent et que les chemins sélectionnés sont couverts.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
testing
Type d'issue
Refactorisation
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.