Open
Conversation
gemtechd
reviewed
Jul 14, 2025
Owner
gemtechd
left a comment
There was a problem hiding this comment.
You got far away
but where are the mocks when they are needed?
tests/geometry-calculation.test.ts
Outdated
| test('isPointOnLine should return true if point is on the line', () => { | ||
| const line = new Line({ point1: new Point({ x: 0, y: 0 }), point2: new Point({ x: 2, y: 2 }) }); | ||
| const point = new Point({ x: 1, y: 1 }); | ||
| const result = isPointOnLine(line, point); |
Owner
There was a problem hiding this comment.
What happens when you call a different function inside a test function??
Something like MOCK??
Author
|
Changing tests as required |
gemtechd
requested changes
Jul 14, 2025
| if (typeof line.slope !== 'number' || typeof line.n !== 'number' || typeof point.x !== 'number' || typeof point.y !== 'number') { | ||
| throw new Error('Invalid input types'); | ||
| } | ||
| const expectedY = line.slope * point.x + line.n; |
Owner
There was a problem hiding this comment.
don't remove the functions
they were build to be used in different modules
you have to mock them in the tests
| this.slope = slope; | ||
| this.n = n; | ||
| this.calculateSlope(); | ||
| this.calculateNOfLineFunction(); |
Owner
There was a problem hiding this comment.
to be more specific, the line can be updated by the points (each point can be moved) so you'll have to calculate this functions again
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merging changes from testing branch to main branch
Tests: