Conversation
gemtechd
left a comment
There was a problem hiding this comment.
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'], |
| line1.calculateSlope(); | ||
| line1.calculateNOfLineFunction(); | ||
| line2.calculateSlope(); | ||
| line2.calculateNOfLineFunction(); |
There was a problem hiding this comment.
You have to execute only one function on each tests
There was a problem hiding this comment.
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.
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.
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(); |
| 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.
don't calculate here, call the functions inside the calculateJunctionPoint function
No description provided.