Concepts

Fresh fixture factory

Try the free JavaScript compiler

Creates independent input state for each test so mutation in one case does not affect another.

Formal Syntax & Structure

javascript syntaxjavascript
const makeFixture = () => ({ rows: [] })

Working Example

Example Snippetjavascript
(async () => {const fixture=()=>({rows:[]});const a=fixture(),b=fixture();a.rows.push("x");console.log(a.rows.length,b.rows.length);})()
JavaScript Reference