If this is your first coding exercise on RealJS, then this tab shows you how the editor, the tests, and the hints work together.
How Coding Exercises Work
A coding exercise runs right here in your browser. You write your code in the editor above, then click Run Tests or press Ctrl+Enter (Cmd+Enter on macOS). Automated tests run your code and mark each test as passed or failed. The exercises in this course never call a real model, so you don’t need an API key for them. In this exercise, askWithTools() is a stand-in that plays scripted replies.
Run the tests early and often, even before you change anything. A failing test’s message tells you what the tests found and what they expected, so read it before you edit. Fix the first failing test, then run the tests again. A different failing test usually means you’ve made progress!
Note: If every test fails with the same short error, such as Unexpected end of input, then JavaScript couldn’t read your code. Check that every block you added is closed, and fix that first.