Replies: 1 comment
-
|
I also tried below test code and it doesn't work.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am new to TS and finished some code. Now i want to prepare UT for the codes. but I encounter one issues. For below sample code,
sum.ts:
I want to write the UT for add function in sum.ts. at this time, i try to mock the add1 function. But i failed, below is my test code.
sum.test.ts:
Though i use spyOn to mock the "add1", it doesn't work. the result is as follows:
how can I mock the "add1" to make the UT for "add" function?
Can anyone help me?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions