Which assertion accuretely tests the above code?

Refer to the code below:

Async funct on functionUnderTest(isOK) {

If (isOK) return ‘OK’ ;

Throw new Error(‘not OK’);

)

Which assertion accuretely tests the above code?
A . Console.assert (await functionUnderTest(true), ‘ OK ’)
B . Console.assert (await functionUnderTest(true), ‘ not OK ’)
C . Console.assert (await functionUnderTest(true), ‘ not OK ’)
D . Console.assert (await functionUnderTest(true), ‘OK’)

Answer: D

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments