Commit cd428df
committed
test(did): assert @context shape before indexing
The dedicated ordering test indexed doc['@context'] and called .includes()
without first checking the field exists, so a regression that dropped
@context entirely would surface as a TypeError instead of the intended
assertion message — defeating the reason the check is a separate test.
Bind @context to a local, assert Array.isArray first, then check the
ordering. Verified: with @context removed from the builder the test now
fails with '@context must be present and an array' rather than a
TypeError.1 parent e371856 commit cd428df
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
155 | 159 | | |
156 | 160 | | |
157 | 161 | | |
158 | | - | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
0 commit comments