A successful command is not the same as a verified test run. Check the exact command and exit status, the number of tests that actually passed, skips and cancellations, and the files selected. Then inspect whether independent assertions cover the behavior you requested. This guide uses a small Node.js example you can run locally; it does not claim to measure every AI coding agent.
A coding agent returns a confident summary: the change is complete and the tests are green. That statement is a useful lead, not the result itself. The command could have run the wrong file, selected no relevant tests, skipped a test, or exercised a test that accepts both correct and broken implementations. These are different problems. A single green indicator cannot distinguish them.
The example below separates three questions: did a command finish successfully, did a test actually execute, and did that test distinguish the expected behavior from a plausible defect? A fourth question comes afterward: did the change meet the whole task? Even a good test run may cover only part of the requested work.
Reproduce a successful command with no passing tests
Create a file called skipped.test.mjs. Import test from node:test, then register one test with test.skip. Give the test a body that throws an error. Run node --test skipped.test.mjs. The body never runs, yet on Node.js 22.23.4 our local run exited with status zero and the summary reported zero passing tests and one skipped test.
This does not mean Node.js is broken. A skip is a declared outcome, and the runner reports it. The mistake is treating the process exit code as the whole acceptance criterion. If a critical check was skipped, an exit code of zero cannot establish that the behavior passed. The runnable files on this site include the skipped case, a passing case, a failing case and a small gate that demonstrates how their summaries differ.
Our observation is deliberately narrow. It records the version, file and output checked on November 15, 2026. It is not a benchmark of agent reliability or evidence that any named model skipped a test. Run it on the Node version used by your project and compare the actual output with the documentation for that version.
Start with a written acceptance condition
Before the agent changes code, state the behavior and the boundary. For a checkout example, the requirement might be: an order of 100 qualifies for free shipping, while an order below 100 does not. That gives reviewers a concrete question and a boundary that can be wrong. “Make shipping work” is less useful because the implementation and the test can share an unstated assumption.
List the expected test command and where it must run. Record any prerequisites, test accounts, services or environment variables. If one of them is unavailable, the result should say so. A command that could not run is not a failed assertion, and neither is it a pass. Mark the outcome unknown until the missing dependency is resolved or a different appropriate check is performed.
Keep the acceptance condition independent of the code the agent plans to write. If the test merely calls the same helper to calculate both the actual and expected result, the test can repeat the implementation’s error. For critical behavior, compare an observable result with an example derived from the requirement, a trusted specification or an independently checked reference.
Break the agreement loop
Record what ran, not just what was requested
A useful run record contains the command, working directory, tool and version, exit status, start and finish, and a summary of passed, failed, skipped and cancelled tests. Store the record where the next reviewer can find it. Do not include access tokens, private prompts, customer data or full request bodies merely because they appeared in the terminal.
Compare the test runner’s discovered files with the intended scope. A command aimed at one package does not prove that another package’s tests ran. A filtered command may be exactly right for a small change, but its narrower scope needs to be visible in the final report. If a critical integration test requires a service that was not started, report that gap rather than treating a unit-test pass as a substitute.
The exact format differs between runners. Node’s default test output in the example reports totals as TAP comments. Other runners expose structured reports or a machine-readable file. Prefer a documented output format and pin the version used by the check. A log parser that assumes one reporter’s wording can silently misread a different format; missing or malformed evidence should make the result inconclusive.
Treat skipped and empty runs as distinct outcomes
A skipped test can be intentional. A platform-specific case may not apply to the current operating system, or an integration test may require an explicitly unavailable service. The right policy is not always “zero skips everywhere.” Instead, identify which tests are mandatory for the decision and document any permitted exceptions.
For the tiny demonstration, the policy is intentionally strict: at least one test must pass, and any skip, failure, cancellation or TODO causes rejection. That makes the example easy to inspect. It is not a universal policy for every test suite. A production pipeline may need an allowlist of justified skips, per-platform expectations or separate unit and integration gates.
An empty test run deserves its own result. If no intended test was discovered, there may be no failing assertion, but there is also no evidence of success. Check both the reported count and the test selection. Where supported, have the runner produce a list of collected test identifiers and compare it with an expected set maintained independently of the generated change.
Run the local gate and inspect its limits
Download the example archive and run node --test gate.test.mjs. The three tests exercise the gate against a genuinely passing test, a skipped test, and a failing test. In our local run all three gate tests passed: the gate accepted the passing case and rejected the other two. You can also run node gate.mjs skipped.test.mjs and observe the expected nonzero gate exit even though the underlying Node test command returns zero.
The gate reads a trusted Node 22 default TAP summary. It is deliberately small, not a security boundary. Test code can print misleading text, change files or perform side effects, so do not run untrusted code merely because a sample gate exists. Run trusted fixtures in an isolated environment, check the expected files and command, and protect the test definitions and CI configuration through your normal review process.
Do not overread the gate’s accept result. It says the runner reported at least one passing test and none of the explicitly rejected outcomes in the parsed summary. It does not prove that the assertions reflect the specification, that all desired tests were selected, or that the implementation is safe. Those require additional checks with their own evidence.
Test that a test can catch the defect
In a separate shipping example, a faulty function uses a strict greater-than comparison where the requirement includes the threshold. A weak test checks an order above the threshold and passes. An independent test checks the boundary itself and fails against the faulty function. After the comparison is corrected, both tests pass.
This is not a measurement of an AI model. It is a constructed example showing why a test name and a green result do not establish that the test would catch the bug. Download the two tests and the function, run them as provided, then make the one-character correction and repeat. Keep the initial version if you want to demonstrate the failure again; otherwise you can accidentally test only the already-corrected file.
Mutation is a useful diagnostic, not a substitute for requirements. Introduce a plausible wrong behavior and see whether the relevant test fails. If it does not, investigate the assertion and the test data. If it does, you have evidence against that particular defect under that setup, not proof against all possible defects.
Selected output from our local Node.js run. The example uses English test names; the first run misses the boundary and the second catches it.
export function shipping(total) { return total > 100 ? 0 : 5 }
Tested November 15, 2026: we ran the weak and boundary tests with Node.js, then changed > to >= and reran both. This checks the example, not any AI model.
Run the same comparison yourself
Download and extract the bundle, then open a terminal in that folder. No package installation is needed.
First run: weak test passes; boundary test fails because shipping(100) returns 5.
Change only total > 100 to total >= 100 in checkout.mjs. Rerun both tests: both should pass. If you get an import or setup error, fix that before drawing a conclusion.
When an agent reports success, inspect the test changes as well as the implementation. Look for removed assertions, renamed files excluded by the runner, new skips, broad mocks and changed test configuration. Each change can have a legitimate reason. The reviewer’s job is to connect the change to the requirement and confirm that the check still exercises the behavior that matters.
Pay particular attention to a test that was modified after it failed. Was the expected value corrected because the requirement changed, or was it changed to match the implementation? Is the test checking an external effect, or only asserting that a mocked method was called? A mock can help isolate a unit, but it cannot alone prove that an integration with a real provider works.
Compare the final diff with the originally requested acceptance conditions. If the agent was asked to keep a regression test, confirm it still exists and is selected by the command. If the agent could edit the test harness, protect critical checks outside the agent’s writable scope or review them independently. A gate stored beside editable tests is convenient, but it is not independent protection against a misleading change to both.
Keep authorization and retries separate
A green test run is not authorization for an action. If an agent proposes a write, validate its shape, decide whether the caller may act on the target, and obtain any approval from trusted state. The local authorization example on this site rejects malformed, unexpected, unauthorized and unapproved proposals. Its tests describe a toy policy; real permissions and enforcement belong to the application.
Retries need a different check. A timeout can happen after a remote write succeeds but before the response arrives. Inspect the provider’s idempotency and status contracts, reconcile the outcome when possible, and retry only under conditions that prevent duplicate effects or allow them to be detected and repaired. A test runner returning zero cannot tell you whether a remote action occurred exactly once.
Record these decisions separately in the handoff: what was proposed, what was authorized, what was executed, and what evidence confirms the result. Avoid storing secrets or sensitive prompt contents. If the outcome is unknown, leave it unknown and investigate rather than turning uncertainty into a completion message.
Make an honest completion report
A useful final report identifies the changed artifact, the checks actually run, their results and any uncovered requirements. For example: “The boundary function was changed. The local unit test checked 99, 100 and 101 and passed. The integration test was not run because the service was unavailable.” That is more actionable than “everything works.”
The reader should be able to reopen the files and repeat the checks. If a result depends on a provider version, a fixture or a particular environment, say so. When a command is blocked, preserve the error and next step rather than claiming a pass. If the agent’s wording and the evidence disagree, keep both in the record and investigate the discrepancy.
A completion claim can be supported by evidence without becoming a guarantee. Independent expected values, a visible test selection, a runner summary and an inspected artifact each answer a different question. Together they reduce the chance that a polished message hides missing work; they do not eliminate the need for review.
What to do next
Start with one consequential workflow, not every test in the repository. Write the acceptance condition, run the local skipped-test example, and compare your own runner’s summary with the selected files. Add one independent boundary case and one deliberately wrong implementation to see whether the check detects the failure.
Then connect the result to the broader workflow: use the generated-test guide for assertion quality, the completion guide for handoffs, the authorization guide for tool actions, and the retry guide for uncertain writes. The experiments page links the runnable examples and their limitations. Update your process only after the checks answer a real decision in your environment.
Source checked November 15, 2026: Node.js documents skipped tests and test-runner behavior. The observed exit code is specific to our local example. Node.js ↗