CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-jest-expect-message

Add custom message to Jest expects

Overall
score

99%

Overview
Eval results
Files

rubric.jsonevals/scenario-3/

{
  "context": "This criteria evaluates how effectively an engineer uses jest-expect-message to add custom error messages to Jest assertions. The focus is on proper usage of the library's API including the second message parameter, configuration options, and appropriate application across synchronous and asynchronous test scenarios.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Basic custom messages",
      "description": "Uses expect() with custom message as second parameter (e.g., expect(value, 'descriptive message').toBe(expected)) in at least 3 test cases",
      "max_score": 30
    },
    {
      "name": "Async matcher messages",
      "description": "Applies custom messages to asynchronous assertions using .resolves or .rejects matchers (e.g., expect(promise, 'message').resolves.toBe() or expect(promise, 'message').rejects.toThrow())",
      "max_score": 25
    },
    {
      "name": "Message quality",
      "description": "Custom messages are descriptive, contextual, and clearly explain what is being tested or what failure would indicate (not just repeating the assertion)",
      "max_score": 20
    },
    {
      "name": "Configuration options",
      "description": "Uses the optional third parameter to configure error display (e.g., { showPrefix: false }, { showMatcherMessage: false }, or { showStack: false }) in at least one test",
      "max_score": 15
    },
    {
      "name": "Setup configuration",
      "description": "Properly configures jest-expect-message in Jest setup (e.g., imports 'jest-expect-message' in test file or configures in setupFilesAfterEnv)",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-jest-expect-message

tile.json