diff --git a/integration/forgejo.py b/integration/forgejo.py index b303154..0a1efe9 100755 --- a/integration/forgejo.py +++ b/integration/forgejo.py @@ -307,6 +307,7 @@ class Forgejo: data["login"] = self.username data["email"] = self.email data["repo"] = repo + data["forgejo_url"] = self.get_uri("") content = json.dumps(data) f.write(content) print(f"Wrote access token to {file}") diff --git a/src/api.test.ts b/src/api.test.ts index e9abbae..cce70c9 100644 --- a/src/api.test.ts +++ b/src/api.test.ts @@ -5,14 +5,15 @@ import Forgejo from "./index"; import authtoken from "../secrets/user1-accesstoken.json"; +const forgeoUrl = authtoken["forgejo_url"]; const token = authtoken["sha1"]; const username = authtoken["login"]; const repo = authtoken["repo"]; -const api = new Forgejo("http://localhost:3000", "owner_user"); +const api = new Forgejo(forgeoUrl, "owner_user"); api.setTokenAuth(token); test("use authentication without setting it ", () => { - const api = new Forgejo("http://localhost:3000", "owner_user"); + const api = new Forgejo(forgeoUrl, "owner_user"); expect(() => api.getTokenAuth()).toThrow(); api.setTokenAuth(token);