I\'m working in typescript 1.5 in visual studio. I have a main class called app.ts, and another called FizzBuzzManager.ts. I can\'t figure out what is wrong with this code,
For future readers, the problem could also be if the constructor expects parameters and you are giving no parameters or a different number of parameters. This is because for Javascript a function with a different number of parameters is a different function.
A simple solution could be to add default parameters in the constructor.
My example was like this:
SegmentsQueryBuilder.ts
class SegmentsQueryBuilder {
//...
constructor(scoping) {
//...
}
//...
}
segments.query.builder.test.ts
describe('Segment base query', () => {
test('should create segment select with default fields', () => {
const segmentQueryBuilder = new SegmentQueryBuilder() //ERROR HERE
//...
The solution here was either to use default parameter in the constructor or to pass the scoping object in the usage of the constructor