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 how well an engineer uses Jest's equality matchers (toBe, toEqual, toStrictEqual) to test different comparison scenarios. The focus is on selecting the appropriate matcher for each use case.",
"type": "weighted_checklist",
"checklist": [
{
"name": "toBe for primitives",
"description": "Uses toBe() matcher for primitive value comparisons (numbers, strings, booleans) in primitive-equality.test.js",
"max_score": 20
},
{
"name": "toEqual for objects",
"description": "Uses toEqual() matcher for comparing object instances with identical properties in object-equality.test.js",
"max_score": 20
},
{
"name": "toBe fails reference",
"description": "Uses toBe() with .not modifier or uses expect().not.toBe() to verify that different object instances are not reference-equal in object-equality.test.js",
"max_score": 15
},
{
"name": "toEqual for arrays",
"description": "Uses toEqual() matcher for comparing array instances with identical elements in object-equality.test.js",
"max_score": 15
},
{
"name": "toEqual for nested",
"description": "Uses toEqual() matcher for comparing deeply nested objects with identical structure in nested-equality.test.js",
"max_score": 15
},
{
"name": "toStrictEqual vs toEqual",
"description": "Demonstrates the difference between toEqual() and toStrictEqual() when comparing objects with undefined properties in nested-equality.test.js, showing that toEqual() passes while toStrictEqual() fails (or vice versa)",
"max_score": 15
}
]
}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