test: the SPA's chat tests on the port, client, store and link embeds
- vitest runs app/**/*.test.ts and tests/**/*.test.ts; the SPA's chatEvents, chatFormat, chatText, chatUnread and realtime tests sit next to their ports with only import paths changed - linkEmbeds: escaping, http(s) only, rel and target, registry order - client: every endpoint, refresh-and-retry, unauthorized, 422, upload - store: bootstrap, anonymous and non-member starts, lazy joins, DMs, live messages and unread, threads, pins, reactions, slash commands, polling without realtime, onUserEvent, DM-only actions
This commit is contained in:
12
tests/support/http.ts
Normal file
12
tests/support/http.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// bm's ApiError (src/api/http.ts), for the ported realtime test: it rejects
|
||||
// the stubbed token route with one, and the route answers its status.
|
||||
export class ApiError extends Error {
|
||||
status: number
|
||||
errors: Record<string, string[]>
|
||||
constructor(status: number, message: string, errors: Record<string, string[]> = {}) {
|
||||
super(message)
|
||||
this.name = 'ApiError'
|
||||
this.status = status
|
||||
this.errors = errors
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user