Skip to content

add second test#2

Open
eric891224 wants to merge 1 commit intomainfrom
hw-p
Open

add second test#2
eric891224 wants to merge 1 commit intomainfrom
hw-p

Conversation

@eric891224
Copy link
Contributor

added a test for the edge case in which any of the inputs to add is not of type number

@eric891224
Copy link
Contributor Author

lgtm

@eric891224 eric891224 self-assigned this Apr 6, 2025
expect(() => math.add(1, "2" as any)).toThrow("Both arguments must be numbers")
expect(() => math.add("1" as any, 2)).toThrow("Both arguments must be numbers")
expect(() => math.add("1" as any, "2" as any)).toThrow("Both arguments must be numbers")
expect(() => math.add(1, null as any)).toThrow("Both arguments must be numbers")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should add another test that checks when the first argument is null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant