#testing prototype function in jasmine

21 messages · Page 1 of 1 (latest)

lusty salmon
#

can someone please help me?

wintry fossil
#

The problem is not about your test but your code. I guess res is not typed.

#

And the code itself is broken as there is a missing )

lusty salmon
#

res is not typed like in typescript terms?

#

sorry i just forgot to add the bracket

wintry fossil
lusty salmon
#

the fix

wintry fossil
#

Like a proper type, not any.

#

And that's not even valid syntax. Type res where you define it

lusty salmon
#

it is object can you show me once sorry for troubling

wintry fossil
#

Adding types is not even about fixing your error, it's about using proper API: it feels like you are using random code as you don't even understand the format of your data

wintry fossil
lusty salmon
#

but no in my team has done that

#

will it help cover the testcase?

wintry fossil
#

That's why we use types, to help ourselves.

#

No as I would fix the code firstly following previous advices. Good luck

lusty salmon
#

the code is already fixed

#

it works in local

#

just want suggesitons or statements

#

that's it