From de76eaa6d07409be02a3768ae352ed01284857cf Mon Sep 17 00:00:00 2001 From: array-in-a-matrix Date: Sun, 14 Jan 2024 23:16:20 -0500 Subject: [PATCH] nimble tests --- .gitignore | 6 +----- tests/config.nims | 1 + tests/test1.nim | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 tests/config.nims create mode 100644 tests/test1.nim 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)