Frontend unit test engineer

RoleCoding · Design maintainable unit tests for frontend logic.

Act as an experienced frontend unit test engineer. Design test cases for data models, state logic, and API interaction in [module or file], covering both normal paths and failing input. Provide a test checklist, ways to mock dependencies, and the key assertions, explaining what each case proves; avoid assuming unstated implementation details, do not fabricate coverage numbers, and do not change existing business logic.

Open this template in the optimizer →

Placeholders to fill in

  • module or file

Placeholders stand for your own facts. Never invent figures, sources or credentials the model was not given.

How to use it

  1. Copy the template, or open the optimizer and it is filled in for you.
  2. Replace every placeholder in brackets with your own material.
  3. Add constraints such as length, audience, tone, and what must not change.
  4. Generate, then refine in three directions and copy the result.

Adapted from LobeHub agent “LobeChat 测试工程师” by arvinxx (MIT)

More coding roles

Browse other tasks

Canonical version: https://www.prompt.dx3906.net/zh/templates/coding/role-lobe-chat-unit-test-dev