test(api/rest): add basic endpoint tests

This commit is contained in:
Cilly Leang 2026-02-16 15:51:03 +11:00
parent c7fb2817fc
commit 46218aa3c7
Signed by: cilly
GPG key ID: 6500251E087653C9
9 changed files with 253 additions and 8 deletions

View file

@ -24,7 +24,14 @@ internal data class PlatformProps(
internal expect val platformSuperProps: PlatformProps
object ApiConstants {
val superProps = Base64.encode(Json.encodeToString(SuperProperties()).encodeToByteArray())
@OptIn(ExperimentalSerializationApi::class)
val json = Json {
namingStrategy = JsonNamingStrategy.SnakeCase
ignoreUnknownKeys = true
encodeDefaults = true
}
val superProps = Base64.encode(json.encodeToString(SuperProperties()).encodeToByteArray())
val baseHeaders = mapOf(
"X-Debug-Options" to "bugReporterEnabled",
"X-Discord-Locale" to "en-US",
@ -34,13 +41,6 @@ object ApiConstants {
const val userAgent = "Discord-Android/311020;RNA"
const val gatewayUserAgent = "okhttp/4.12.0"
@OptIn(ExperimentalSerializationApi::class)
val json = Json {
namingStrategy = JsonNamingStrategy.SnakeCase
ignoreUnknownKeys = true
encodeDefaults = true
}
// TODO: Desktop uses separate properties
@Suppress("PropertyName")
@Serializable