A collection of utilities for the Daggerheart SRD katari.fyi
daggerheart ttrpg gleam api
at main 28 lines 599 B view raw
1import envoy 2import gleam/http 3import gleam/result 4import gleam/string 5import gleeunit 6import shared/data 7import web/router 8import wisp/testing 9 10pub fn main() -> Nil { 11 gleeunit.main() 12} 13 14pub fn docs_show_not_found_when_disabled_test() { 15 let req = testing.request(http.Get, "/docs/", [], <<>>) 16 let res = router.handle_request(req, data(), False) 17 18 assert res.status == 200 19 assert res 20 |> testing.string_body() 21 |> string.contains("not found") 22} 23 24fn data() { 25 let path = result.unwrap(envoy.get("KATARI_SRD_PATH"), "../srd/") 26 let assert Ok(data) = data.read_data_dir(path:) 27 data 28}