nimble tests

This commit is contained in:
array-in-a-matrix 2024-01-14 23:16:20 -05:00
parent ee95dc2c78
commit de76eaa6d0
3 changed files with 16 additions and 5 deletions

6
.gitignore vendored
View file

@ -142,8 +142,4 @@ config.json
storage.json
# compiled nim output
index.js
# testing stuff
test/
*test*
*.js

1
tests/config.nims Normal file
View file

@ -0,0 +1 @@
switch("path", "$projectDir/../src")

14
tests/test1.nim Normal file
View file

@ -0,0 +1,14 @@
import unittest
import jsconsole
import nimbotsdk
test "can login using username and password":
const
homeserver: cstring = ""
username: cstring = ""
password: cstring = ""
let auth = newMatrixAuth(homeserver)
let client = auth.passwordLogin(username, password)
console.log(client.accessToken)