diff --git a/src/index.ts b/src/index.ts index 725c454..3d66a19 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,7 +60,7 @@ export async function createMetricsComponent { const res = await fetch.fetch("/a/metrics", { headers: { authorization: "Bearer asd" } }) expect(res.status).toEqual(200) }) + + it("responds the /a/metrics endpoint with 401 with invalid token", async () => { + const { fetch } = getComponents() + const res = await fetch.fetch("/a/metrics", { headers: { authorization: "Bearer xxxxxxxxx" } }) + expect(res.status).toEqual(401) + }) })