const calls = []; ` ${{ [Symbol.toPrimitive]() { calls.push(1); return "foo"; } }} ${1 + { valueOf() { calls.push(2); return 2; } }} `; expect(calls).toEqual([1, 2]);