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 missing test coverage #115

Open
Tracked by #142
bnonni opened this issue Aug 26, 2024 · 5 comments
Open
Tracked by #142

Add missing test coverage #115

bnonni opened this issue Aug 26, 2024 · 5 comments
Assignees
Labels
good first issue Good for newcomers hacktoberfest 2024 Related to hacktoberfest 2024 help wanted Extra attention is needed package: all Directly impacts all packages in the repo testing Related to new or existing tests

Comments

@bnonni
Copy link
Contributor

bnonni commented Aug 26, 2024

Test coverage is currently at ~48%. This is the minimum coverage needed for current development; however, ideally, we'd like to have 100% coverage.

@bnonni bnonni added good first issue Good for newcomers testing Related to new or existing tests package: all Directly impacts all packages in the repo help wanted Extra attention is needed hacktoberfest 2024 Related to hacktoberfest 2024 labels Aug 26, 2024
@MuskanSaxena6
Copy link

.take

Copy link

Thanks for taking this issue! Let us know if you have any questions!

@MuskanSaxena6
Copy link

MuskanSaxena6 commented Oct 18, 2024

Am i supposed to set these values according to me: ISSUER_WEB5_PASSWORD=' ', ISSUER_WEB5_RECOVERY_PHRASE=' ' ?

@bnonni
Copy link
Contributor Author

bnonni commented Oct 22, 2024

Am i supposed to set these values according to me: ISSUER_WEB5_PASSWORD=' ', ISSUER_WEB5_RECOVERY_PHRASE=' ' ?

@MuskanSaxena6 you can set them manually in a .env or if you look at issuer/src/config.ts you'll see the config object is looking for process.env.ISSUER_WEB5_PASSWORD and
process.env.ISSUER_WEB5_RECOVERY_PHRASE in the env or if null, coalesce to a function from the Mnemonic class to fill it. Setting these vars in .env is more for BYO-Keys. If you don't have a pre-existing Agent DID recovery phrase and password, I recommend allowing the Mnemonic class to auto-populate them. You can also use that same class to explicitly define those vars wherever you need them.

Recommendation
Because this is a test coverage issue, I recommend either letting the config.ts code handle the auto-population or importing Mnemonic and explicitly defining a new ISSUER_WEB5_PASSWORD and ISSUER_WEB5_RECOVERY_PHRASE in the test case you're writing. If you look in the issuer/tests folder and specifically the issuer/tests/issuer.spec.ts test file, you'll find good starting points for understanding what has been setup already and where to go from here. Looking at issuer.spec.ts and config.spec.ts, you can see there's only 2 tests for the issuer package. Ideally, we'd have coverage for all the parts of the issuer package code + the applicant, common and server code bases.

Feel free to send me your questions in the TBD Discord channel for #dcx. I tend to not see GitHub comments as quickly.

@MuskanSaxena6
Copy link

Am i supposed to set these values according to me: ISSUER_WEB5_PASSWORD=' ', ISSUER_WEB5_RECOVERY_PHRASE=' ' ?

@MuskanSaxena6 you can set them manually in a .env or if you look at issuer/src/config.ts you'll see the config object is looking for process.env.ISSUER_WEB5_PASSWORD and
process.env.ISSUER_WEB5_RECOVERY_PHRASE in the env or if null, coalesce to a function from the Mnemonic class to fill it. Setting these vars in .env is more for BYO-Keys. If you don't have a pre-existing Agent DID recovery phrase and password, I recommend allowing the Mnemonic class to auto-populate them. You can also use that same class to explicitly define those vars wherever you need them.

Recommendation
Because this is a test coverage issue, I recommend either letting the config.ts code handle the auto-population or importing Mnemonic and explicitly defining a new ISSUER_WEB5_PASSWORD and ISSUER_WEB5_RECOVERY_PHRASE in the test case you're writing. If you look in the issuer/tests folder and specifically the issuer/tests/issuer.spec.ts test file, you'll find good starting points for understanding what has been setup already and where to go from here. Looking at issuer.spec.ts and config.spec.ts, you can see there's only 2 tests for the issuer package. Ideally, we'd have coverage for all the parts of the issuer package code + the applicant, common and server code bases.

Feel free to send me your questions in the TBD Discord channel for #dcx. I tend to not see GitHub comments as quickly.

@bnonni thanks a lot , you could have easily given me the answer in a single line but you explained it in such a detailed manner, I'm learning a lot!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest 2024 Related to hacktoberfest 2024 help wanted Extra attention is needed package: all Directly impacts all packages in the repo testing Related to new or existing tests
Projects
None yet
Development

No branches or pull requests

2 participants