-
Notifications
You must be signed in to change notification settings - Fork 10
tests #5
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
base: main
Are you sure you want to change the base?
tests #5
Conversation
gemtechd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each test has to execute only one function
If you need code, you have to change the code itself
jest.config.js
Outdated
| module.exports = { | ||
| preset: 'ts-jest', | ||
| testEnvironment: 'node', | ||
| roots: ['<rootDir>/modules/tests'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?
| line1.calculateSlope(); | ||
| line1.calculateNOfLineFunction(); | ||
| line2.calculateSlope(); | ||
| line2.calculateNOfLineFunction(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to execute only one function on each tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still have to fix the proble, with calling more then one function in a test
|
I tested the functions :calculateSlope() and -calculateNOfLineFunction() in the line.test.ts file. |
gemtechd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the problem in the tests with calling 2 functions
| line1.calculateSlope(); | ||
| line1.calculateNOfLineFunction(); | ||
| line2.calculateSlope(); | ||
| line2.calculateNOfLineFunction(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still have to fix the proble, with calling more then one function in a test
| const p2 = new Point({ x: 2, y: 5 }); | ||
| const line = new Line({ point1: p1, point2: p2 }); | ||
| line.calculateSlope(); | ||
| line.calculateNOfLineFunction(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 functions
| line1.slope = (p2.y - p1.y) / (p2.x - p1.x); | ||
| line1.n = p1.y - line1.slope * p1.x; | ||
| line2.slope = (p2.y - p1.y) / (p2.x - p1.x); | ||
| line2.n = p1.y - line2.slope * p1.x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't calculate here, call the functions inside the calculateJunctionPoint function
No description provided.