exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 316 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 316
Topic #: 1
[All Certified Platform Developer II Questions]

A developer has created a Lightning web component that uses the getRecord wire adapter.

Which three things should the developer do in a Jest test to validate the wire method is working as expected? (Choose three.)

  • A. Use an assert statement to validate results.
  • B. Import wire from lwc.
  • C. Use the emit() API.
  • D. Create a JSON file with mock data.
  • E. Import getRecord from lightning/uiRecordApi.
Show Suggested Answer Hide Answer
Suggested Answer: BCE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
moitam
9 months ago
Selected Answer: ACD
https://trailhead.salesforce.com/content/learn/modules/test-lightning-web-components/write-a-jest-test-for-wire-service
upvoted 2 times
...
BrucePark
10 months ago
Selected Answer: CDE
A. Wrong, no assert statement, Maybe expect().tobe() ? B. Wrong, in Jest wire is not necessary C. Correct D. Correct E. Correct Ref. https://developer.salesforce.com/docs/platform/lwc/guide/unit-testing-using-wire-utility.html
upvoted 2 times
moitam
9 months ago
Isn't expect().tobe() an assertion? I think it is for me is A, C and D https://trailhead.salesforce.com/content/learn/modules/test-lightning-web-components/write-a-jest-test-for-wire-service
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...