Commit 33e9777
authored
test(utils): check boundary robustness of JSON response serializer (JhaSourav07#1646)
Fixes JhaSourav07#1556
## Description
Added a boundary test to verify that `trackUser` handles
non-serializable
JSON payloads gracefully without throwing. Also updated `tracking.ts` to
wrap `JSON.stringify` in a try/catch to prevent uncaught exceptions.
## Changes Made
- Added test for circular reference input in `utils/tracking.test.ts`
- Wrapped `JSON.stringify` in try/catch in `utils/tracking.ts`
## Pillar
- [x] 🛠️ Other (Bug fix, refactoring, docs)
## Checklist
- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally.
- [x] `npm run format` and `npm run lint` pass locally ✅
- [x] `npm run test` passes locally ✅
- [x] My commits follow Conventional Commits format.
- [x] I have starred the repo.
- [x] I have only one commit in this PR.
- [x] (Recommended) I joined the CommitPulse Discord server.1 parent 74c5188 commit 33e9777
2 files changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
117 | 135 | | |
118 | 136 | | |
119 | 137 | | |
| |||
128 | 146 | | |
129 | 147 | | |
130 | 148 | | |
131 | | - | |
132 | 149 | | |
133 | | - | |
134 | 150 | | |
135 | | - | |
136 | 151 | | |
137 | 152 | | |
138 | | - | |
139 | 153 | | |
140 | 154 | | |
141 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
| |||
0 commit comments