import Forgejo from "./api"; import authtoken from "../secrets/user1-accesstoken.json"; test("use authentication without setting it ", () => { const api = new Forgejo("http://localhost:3000", "owner_user"); const token = authtoken["sha1"] expect(() => api.getTokenAuth()).toThrow(); api.setTokenAuth(token) expect(api.getTokenAuth().getToken()).toBe(token) });