Add custom message to Jest expects
Overall
score
99%
{
"context": "This criteria evaluates how well the engineer configures and uses jest-expect-message to enable global custom error messages in Jest assertions. It focuses on proper setup, correct usage of the enhanced expect API, and understanding of how the library wraps Jest's global expect function.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Library import",
"description": "The setup file properly imports or requires 'jest-expect-message' to initialize the global expect enhancement",
"max_score": 30
},
{
"name": "Jest configuration",
"description": "Jest is configured to run the setup file via setupFilesAfterEnv in package.json or jest.config.js to enable the enhancement globally across all test files",
"max_score": 25
},
{
"name": "Custom message usage",
"description": "Tests use the enhanced expect function with custom messages as the second parameter (e.g., expect(value, 'custom message').toBe(expected))",
"max_score": 25
},
{
"name": "Matcher compatibility",
"description": "Tests demonstrate that custom messages work with different matcher types including basic matchers (toBe, toEqual) and negated matchers (not.toBe)",
"max_score": 20
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-jest-expect-messagedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10