12 lines
373 B
TypeScript
12 lines
373 B
TypeScript
|
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)
|
||
|
});
|