Skip to content

London | 26-ITP-January | Karla Grajales | Sprint 3 | 1-implement-and-rewrite-tests#1036

Open
Grajales-K wants to merge 16 commits intoCodeYourFuture:mainfrom
Grajales-K:coursework/sprint-3-implement-and-rewrite
Open

London | 26-ITP-January | Karla Grajales | Sprint 3 | 1-implement-and-rewrite-tests#1036
Grajales-K wants to merge 16 commits intoCodeYourFuture:mainfrom
Grajales-K:coursework/sprint-3-implement-and-rewrite

Conversation

@Grajales-K
Copy link

@Grajales-K Grajales-K commented Feb 23, 2026

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

In this project, I learned how to implement functions and write comprehensive test cases using assertions and error handling (throw). I also practiced using helper functions to improve test readability and finally transitioned to Jest by exporting the logic as a module.

Questions

Hi, I have a question regarding the testing strategy. When and why is it better to implement manual assertions versus using a framework like Jest? Are there specific rules or industry standards on when to use each approach?
Thank you.

@github-actions

This comment has been minimized.

3 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Grajales-K Grajales-K added 🏕 Priority Mandatory This work is expected 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Submit:PR Module-Structuring-And-Testing-Data The name of the module. labels Feb 23, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 23, 2026
@github-actions

This comment has been minimized.

4 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Grajales-K Grajales-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 23, 2026
@Grajales-K Grajales-K added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 24, 2026
@illicitonion illicitonion added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 4, 2026
Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generally looking really good, well done!

On your question:

Hi, I have a question regarding the testing strategy. When and why is it better to implement manual assertions versus using a framework like Jest? Are there specific rules or industry standards on when to use each approach?

In real life, we almost always use a testing framework - they tend to have lots of convenience things (e.g. as you've seen here expect(...).toThrow(...) is much more convenient to write than having to do a try-catch and failing the test in the try after the code you're testing - you can build these things up yourself, but frameworks exist to do this for you :)

@illicitonion illicitonion added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 4, 2026
@Grajales-K Grajales-K added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 4, 2026
@Grajales-K
Copy link
Author

This is generally looking really good, well done!

On your question:

Hi, I have a question regarding the testing strategy. When and why is it better to implement manual assertions versus using a framework like Jest? Are there specific rules or industry standards on when to use each approach?

In real life, we almost always use a testing framework - they tend to have lots of convenience things (e.g. as you've seen here expect(...).toThrow(...) is much more convenient to write than having to do a try-catch and failing the test in the try after the code you're testing - you can build these things up yourself, but frameworks exist to do this for you :)

Hi @illicitonion, that makes a lot of sense. Building manual assertions was a great exercise to understand how testing works under the hood, but I can see how expect(...).toThrow() indeed is much cleaner and more efficient for real-world projects.

Thank you very much for your time.

@Grajales-K Grajales-K requested a review from illicitonion March 4, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected 📅 Sprint 3 Assigned during Sprint 3 of this module Submit:PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants