Updated mocha & nyc, resolved all lint issues in tests/

This commit is contained in:
2022-08-20 13:05:24 +02:00
parent 9708a6cff9
commit a6d808daa6
18 changed files with 996 additions and 1207 deletions

View File

@@ -3,14 +3,15 @@ const app = require("../../src/webserver/app");
const resetDatabase = require("../helpers/resetDatabase");
// const assert = require("assert");
describe('As a user I want a forbidden error if the token is malformed', () => {
before(() => resetDatabase());
describe("As a user I want a forbidden error if the token is malformed", () => {
beforeEach(() => resetDatabase());
it('should return 401', () =>
it("should return 401", () =>
request(app)
.get('/api/v1/pirate/search?query=test')
.set('Authorization', 'maLfOrMed TOKEN')
.expect(401)
.then(response => assert.equal(response.body.error, 'You must be logged in.'))
);
.get("/api/v1/user/settings")
.set("Authorization", "maLfOrMed TOKEN")
.expect(401));
// .then(response => {
// assert.equal(response.body.error, "You must be logged in.");
// }));
});