import test from "ava"; import supertest from "supertest"; import app from "../main.js"; const request = supertest(app); test("get / when not logged should redirect to /login", async function(t) { await request.get("/") .expect("Content-Type", /text\/plain/) .expect(302, /Redirecting to \/login$/); t.pass(); }); test("get /login when not logged in should display the login page", async function(t) { await request.get("/login") .expect("Content-Type", /text\/html/) .expect(200, /