Testing async code means writing tests that wait for asynchronous operations to finish before checking results. In Node.js, this is done by marking the test function as async and using 'await' to pause execution until the Promise resolves. The test then compares the resolved value to the expected result. This prevents tests from ending too early and gives accurate pass/fail results. The execution flow starts with calling the async function, waiting for it to resolve, then asserting the value. Variables like 'data' change from undefined to the resolved value during the test. Forgetting 'await' or 'async' causes the test to behave incorrectly by not waiting for the async operation.