Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "Which Vitest assertion correctly waits for `loadUser()` to reject with `"Not found"`?" on CodeWiki (https://codewiki.com/practice/mcq/javascript/checkpoint-4/checkpoint-4-vitest-rejection/).
Context (verbatim from the page):
"""
Which Vitest assertion correctly waits for `loadUser()` to reject with `"Not found"`?
`await expect(loadUser()).rejects.toThrow("Not found")`
`expect(loadUser()).rejects.toThrow("Not found")` without awaiting or returning it
`expect(await loadUser()).toThrow("Not found")`
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in JavaScript. Where you are unsure, say so.