generated from array-in-a-matrix/matrix-bot-template
nimble tests
This commit is contained in:
parent
ee95dc2c78
commit
de76eaa6d0
3 changed files with 16 additions and 5 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -142,8 +142,4 @@ config.json
|
||||||
storage.json
|
storage.json
|
||||||
|
|
||||||
# compiled nim output
|
# compiled nim output
|
||||||
index.js
|
*.js
|
||||||
|
|
||||||
# testing stuff
|
|
||||||
test/
|
|
||||||
*test*
|
|
||||||
|
|
1
tests/config.nims
Normal file
1
tests/config.nims
Normal file
|
@ -0,0 +1 @@
|
||||||
|
switch("path", "$projectDir/../src")
|
14
tests/test1.nim
Normal file
14
tests/test1.nim
Normal 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)
|
Loading…
Add table
Reference in a new issue