2024-10-19 02:06:08 +00:00
|
|
|
import { configure, getConsoleSink } from "@logtape/logtape"
|
2024-10-20 04:13:09 +00:00
|
|
|
import { doQueryPlayer } from "../src/stratz/api.ts"
|
2024-10-19 02:06:08 +00:00
|
|
|
import { assert, assertEquals} from "@std/assert"
|
|
|
|
|
|
|
|
|
|
|
|
await configure({
|
|
|
|
sinks: { console: getConsoleSink() },
|
|
|
|
filters: {},
|
|
|
|
loggers: [
|
|
|
|
{ category: ["logtape", "meta"], sinks: ["console"], level: "warning" },
|
|
|
|
{ category: ["fedify"], sinks: ["console"], level: "info" },
|
|
|
|
{ category: ["dotino-veloce"], sinks: ["console"], level: "debug" },
|
|
|
|
],
|
|
|
|
})
|
|
|
|
|
|
|
|
Deno.test(async function querySteffo() {
|
|
|
|
const user = await doQueryPlayer(74048532)
|
|
|
|
assert(user)
|
|
|
|
assertEquals(user.id, 74048532)
|
|
|
|
})
|
|
|
|
|
|
|
|
Deno.test(async function queryOne() {
|
|
|
|
const user = await doQueryPlayer(1)
|
|
|
|
assertEquals(user, null)
|
|
|
|
})
|
|
|
|
|
|
|
|
Deno.test(async function queryMinusOne() {
|
|
|
|
const user = await doQueryPlayer(-1)
|
|
|
|
assertEquals(user, null)
|
|
|
|
})
|