diff --git a/.gitignore b/.gitignore index 73edcc9..9ee781b 100644 --- a/.gitignore +++ b/.gitignore @@ -142,8 +142,4 @@ config.json storage.json # compiled nim output -index.js - -# testing stuff -test/ -*test* \ No newline at end of file +*.js diff --git a/tests/config.nims b/tests/config.nims new file mode 100644 index 0000000..3bb69f8 --- /dev/null +++ b/tests/config.nims @@ -0,0 +1 @@ +switch("path", "$projectDir/../src") \ No newline at end of file diff --git a/tests/test1.nim b/tests/test1.nim new file mode 100644 index 0000000..2d4d567 --- /dev/null +++ b/tests/test1.nim @@ -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)