CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-jest-each

Parameterised tests for Jest that enable running the same test multiple times with different data sets using arrays or tagged template literals

85

1.10x
Quality

Pending

Does it follow best practices?

Impact

85%

1.10x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

criteria.jsonevals/scenario-1/

{
  "context": "This evaluation assesses how effectively the engineer uses Jest's mockImplementation and mockImplementationOnce functions to create dynamic mock behavior for testing different payment scenarios. The focus is entirely on proper usage of these specific Jest mocking APIs.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses jest.fn()",
      "description": "Creates mock functions using jest.fn() for the provider functions that need to be mocked",
      "max_score": 15
    },
    {
      "name": "Uses mockImplementation",
      "description": "Employs mockImplementation() to define custom behavior for mock functions, allowing providers to return specific payment results",
      "max_score": 25
    },
    {
      "name": "Uses mockImplementationOnce",
      "description": "Uses mockImplementationOnce() to create different behaviors for sequential calls to the same mock function, enabling tests for varying payment results",
      "max_score": 25
    },
    {
      "name": "Mock return values",
      "description": "Configures mocks to return properly structured payment result objects with status and transactionId fields",
      "max_score": 15
    },
    {
      "name": "Mock error scenarios",
      "description": "Uses mockImplementation or mockImplementationOnce to throw errors, testing error handling in the payment processor",
      "max_score": 10
    },
    {
      "name": "Verifies mock calls",
      "description": "Uses Jest's mock verification matchers (toHaveBeenCalled, toHaveBeenCalledWith) to verify mocks were called correctly",
      "max_score": 10
    }
  ]
}

tile.json