Files
Leviathan/test/routes/test.test.js
Gregory Ballantine 512f7f169e
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Added some more unit tests
2025-08-19 10:29:05 -04:00

34 lines
842 B
JavaScript

const request = require('supertest');
const { expect } = require('chai');
const app = require('../../src/app');
describe('GET /test', () => {
beforeEach(async () => {
const res = await request(app).get('/test');
this.res = res;
});
it('should return a redirect', async () => {
expect(this.res.status).to.equal(302);
});
it('should redirect to /test/list', async () => {
expect(this.res.headers['location']).contains('/test/list');
});
});
describe('GET /test/list', () => {
beforeEach(async () => {
const res = await request(app).get('/test/list');
this.res = res;
});
it('should return a 200 status', async () => {
expect(this.res.status).to.equal(200);
});
it('should return an HTML response', async () => {
expect(this.res.headers['content-type']).match(/text\/html/);
});
});