Skip to content

Commit

Permalink
write tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maradotwebp committed Jul 19, 2021
1 parent b75962d commit 1a70fb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion tests/api/tcf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ block: # fetch mod by id
doAssert cfMod.name == "Biomes O' Plenty"

block: # fetch mod by slug
let cfMod = waitFor(fetchMod("appleskin"))
var cfMod = waitFor(fetchMod("appleskin"))
doAssert cfMod.projectId == 248787
cfMod = waitFor(fetchMod("dtbop"))
doAssert cfMod.projectId == 289529
cfMod = waitFor(fetchMod("dtphc"))
doAssert cfMod.projectId == 307560

block: # fetch mod files
let modFiles = waitFor(fetchModFiles(248787))
Expand Down
8 changes: 5 additions & 3 deletions tests/api/thttp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ discard """
import asyncdispatch, api/http

block: # fetch
let googleHttpsReq = fetch("https://www.google.com")
let googleHttpReq = fetch("http://www.google.com")
let exampleReq = fetch("https://example.com")
waitFor(googleHttpsReq and googleHttpReq and exampleReq)
discard waitFor(exampleReq)

block: # post
let apiTestReq = post("https://httpbin.org/post", "{}")
discard waitFor(apiTestReq)

0 comments on commit 1a70fb3

Please sign in to comment.