You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -572,6 +572,40 @@ Function test_multiple_mock_calls($t : cs.Testing.Testing)
572
572
$t.assert.areEqual($t; "guest"; $stat.getXCallYParameter(2; 1); "Second call should be guest")
573
573
```
574
574
575
+
### ⚠️ **CRITICAL: Avoid `This` in Mock Formulas**
576
+
577
+
**Rule**: Never use `This` directly inside Formula expressions passed to `$t.stats.mock()`.
578
+
579
+
When the test runner calls `Formula.apply()` on test methods, it overrides the `This` context for all nested Formulas, causing `This` references to fail.
0 commit comments