Commit 7b2e0ec
committed
fix(testing): make the no-sdk-mocks guard path-separator agnostic
`relative()` returns host-specific separators, so on Windows the offender
check produced `packages\testing\…` and matched none of the forward-slash
ALLOWLIST keys. Every allowlisted spec would have been reported as an
offender and the guard would have failed for the wrong reason.
That direction is the safe one — a false failure, not a false pass — but a
guard that cries wolf is a guard someone disables, and this one is now the
only thing preventing SDK mocks from returning.
Normalizes to POSIX form before the allowlist lookup. The offender list is
reported in the same form, so its output stays copy-pasteable into the
allowlist on any platform.
The sibling stale-entry check needed no change: it feeds allowlist keys
through `join()`, which normalizes forward slashes on Windows already.
Verified the guard still fails on a planted `vi.mock("@temporalio/workflow")`
and names the file in POSIX form.
Reported by Copilot on #359.1 parent cb31620 commit 7b2e0ec
1 file changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
9 | 23 | | |
10 | 24 | | |
11 | 25 | | |
| |||
70 | 84 | | |
71 | 85 | | |
72 | 86 | | |
73 | | - | |
| 87 | + | |
74 | 88 | | |
75 | 89 | | |
76 | 90 | | |
| |||
0 commit comments