Synchronous — wait for completion. Asynchronous — don't wait.
Synchronous Testing:
Synchronous:
test("add", () => {
const result = add(1, 2);
expect(result).toBe(3);
});
(Immediate result)
Asynchronous Testing:
Asynchronous:
test("fetch", async () => {
const result = await fetchData();
expect(result).toBeDefined();
});
(Handles promise)
Key differences: