フリー問題

Salesforce Certified JavaScript Developer のフリー問題 20 / 20 問目

問題文

A test calls the function under test, stores the result in a variable and then ends. The suite reports it as passing. What is the main defect of this test?

選択肢

  1. It contains no assertion, so it passes for any result and only proves that the call did not throw.
  2. It lacks a teardown step, so state left behind by the call makes the next test unreliable and that is the reason the suite cannot be trusted.
  3. It stores the result in a variable, and a test has to compare the return value inline for the runner to observe the comparison and record it as an assertion.
  4. It calls the function only once, and a single call reaches just one point in the range of possible inputs.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。