Commit 50e1104
committed
test: add the boot harness as npm test and run it in CI
test/harness.js does what main.js does without logging in: it unions the
intents, builds the shared command registry through all three attach() calls,
serializes the exact rest.put payload (33 commands, no duplicates, valid names,
4 context menus), and dispatches mock interactions through the real
InteractionCreate listeners. It also verifies that every gcfg.*_ROLE_ID used
anywhere in the code exists in core/config.js and looks like a snowflake,
exercises the Collection surface discord.js relies on, and round trips the
points system. data/points.json is restored afterwards, so the run is safe on a
machine holding real data. 58 checks.
The final section makes one unauthenticated request to Discord: it logs in with
an invalid token and asserts Discord rejects it, which proves the REST stack
works end to end. That is the check that caught undici 8 breaking
@discordjs/rest. SKIP_NETWORK_TESTS=1 skips it for offline work.
The header documents what the harness cannot cover: an invalid token fails at
REST authentication, so the gateway WebSocket never opens and @discordjs/ws is
never exercised. An override of that package passed 47 of 47 checks here and
still crashed the bot on startup. Gateway changes need a real login.
Both READMEs gain a Testing section and a short note on why there are no
overrides, and the dependency table was still listing discord.js ^14.26.4 and
dotenv ^16.6.1.1 parent 7c3f32c commit 50e1104
5 files changed
Lines changed: 570 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
264 | 292 | | |
265 | 293 | | |
266 | 294 | | |
| |||
275 | 303 | | |
276 | 304 | | |
277 | 305 | | |
| 306 | + | |
| 307 | + | |
278 | 308 | | |
279 | 309 | | |
280 | 310 | | |
| |||
323 | 353 | | |
324 | 354 | | |
325 | 355 | | |
326 | | - | |
327 | | - | |
| 356 | + | |
| 357 | + | |
328 | 358 | | |
329 | 359 | | |
330 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
331 | 378 | | |
332 | 379 | | |
333 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
265 | 295 | | |
266 | 296 | | |
267 | 297 | | |
| |||
276 | 306 | | |
277 | 307 | | |
278 | 308 | | |
| 309 | + | |
| 310 | + | |
279 | 311 | | |
280 | 312 | | |
281 | 313 | | |
| |||
324 | 356 | | |
325 | 357 | | |
326 | 358 | | |
327 | | - | |
328 | | - | |
| 359 | + | |
| 360 | + | |
329 | 361 | | |
330 | 362 | | |
331 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
332 | 382 | | |
333 | 383 | | |
334 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments