From d7ed1196bdd44d7734d41d91a5e72a71785e0a08 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 5 Jan 2023 02:09:07 +0100 Subject: switched to single quotes string in eslint --- tests/games.spec.js | 30 +++++++++++++++--------------- tests/root.spec.js | 44 ++++++++++++++++++++++---------------------- 2 files changed, 37 insertions(+), 37 deletions(-) (limited to 'tests') diff --git a/tests/games.spec.js b/tests/games.spec.js index 00ae1e7..1d5333c 100644 --- a/tests/games.spec.js +++ b/tests/games.spec.js @@ -1,23 +1,23 @@ -import { beforeEach, describe, test } from "vitest"; -import supertest from "supertest"; +import { beforeEach, describe, test } from 'vitest'; +import supertest from 'supertest'; -import app from "../main.js"; +import app from '../main.js'; -describe.concurrent("Games handlers tests", function() { - describe.concurrent("When not logged in", function() { - test("GET /games", async function() { await supertest(app).get("/games").expect("Content-Type", /text\/plain/).expect(302, /Redirecting to \/login$/); }); - test("GET /games/1", async function() { await supertest(app).get("/games").expect("Content-Type", /text\/plain/).expect(302, /Redirecting to \/login$/); }); +describe.concurrent('Games handlers tests', function() { + describe.concurrent('When not logged in', function() { + test('GET /games', async function() { await supertest(app).get('/games').expect('Content-Type', /text\/plain/).expect(302, /Redirecting to \/login$/); }); + test('GET /games/1', async function() { await supertest(app).get('/games').expect('Content-Type', /text\/plain/).expect(302, /Redirecting to \/login$/); }); }); - describe.concurrent("With valid credentials", function() { + describe.concurrent('With valid credentials', function() { beforeEach(async function(ctx) { - const authResponse = await supertest(app).post("/login") - .send("username=Alice&password=Alice42!") - .expect("Content-Type", /text\/plain/) - .expect("set-cookie", /JDMSessionId=/) + const authResponse = await supertest(app).post('/login') + .send('username=Alice&password=Alice42!') + .expect('Content-Type', /text\/plain/) + .expect('set-cookie', /JDMSessionId=/) .expect(302, /Redirecting to \/games$/); - ctx.cookie = authResponse.get("Set-Cookie"); + ctx.cookie = authResponse.get('Set-Cookie'); }); - test("GET /games", async function(ctx) { await supertest(app).get("/games").set("Cookie", ctx.cookie).expect("Content-Type", /text\/html/).expect(200, /