Assertion

You might say

All the tests passed with green checks, yet the checkout discount is clearly wrong—did the test just run the code without checking the final amount?

An assertion is a check inside a test that verifies whether the actual result matches the expected result, failing immediately when it does not.When testing a “30 off 200+” rule, the test must assert the final total equals 170; running the function with no assertion, or only asserting the total is above 0, still passes when a bug returns 200. Assertions judge each outcome automatically, though an assertion with the wrong expectation can still let bugs through.
AssertexpectAssertionError

You can say this to an AI Agent

Ready to paste into Cursor, Claude Code, or Codex
Structured AI Agent prompt

Review the assertions in the checkout discount tests: replace loose non-empty checks with exact assertions on the final total and visible notice, then introduce a quick bug once to verify the assertion actually fails.

Want your Agent to translate plain-language UI ideas automatically?Install free VibeHub Skill →
Oil UI Pro. Push AI’s design skills to the limit. Usability, existing projects and stricter review.
Further reading