Parameterised tests for Jest that enable running the same test multiple times with different data sets using arrays or tagged template literals
85
{
"context": "This criteria evaluates the engineer's ability to use Jest's mock return value configuration methods (mockReturnValue, mockResolvedValue, mockRejectedValue) to control mock function behavior for both synchronous and asynchronous testing scenarios.",
"type": "weighted_checklist",
"checklist": [
{
"name": "mockReturnValue usage",
"description": "Uses jest.fn().mockReturnValue() or mockReturnValue() on a mock to configure synchronous return values for the getUserById test",
"max_score": 30
},
{
"name": "mockResolvedValue usage",
"description": "Uses jest.fn().mockResolvedValue() or mockResolvedValue() on a mock to configure async resolved values for the createUser test",
"max_score": 30
},
{
"name": "mockRejectedValue usage",
"description": "Uses jest.fn().mockRejectedValue() or mockRejectedValue() on a mock to configure async rejected values for the deleteUser test",
"max_score": 30
},
{
"name": "Test structure",
"description": "Properly structures tests using Jest's describe() and test()/it() blocks, and correctly handles async tests where required",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-jest-eachdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10