34 lines
872 B
JavaScript
34 lines
872 B
JavaScript
const request = require('supertest');
|
|
const { expect } = require('chai');
|
|
const app = require('../../src/app');
|
|
|
|
describe('GET /benchmark', () => {
|
|
beforeEach(async () => {
|
|
const res = await request(app).get('/benchmark');
|
|
this.res = res;
|
|
});
|
|
|
|
it('should return a redirect', async () => {
|
|
expect(this.res.status).to.equal(302);
|
|
});
|
|
|
|
it('should redirect to /benchmark/list', async () => {
|
|
expect(this.res.headers['location']).contains('/benchmark/list');
|
|
});
|
|
});
|
|
|
|
describe('GET /benchmark/list', () => {
|
|
beforeEach(async () => {
|
|
const res = await request(app).get('/benchmark/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/);
|
|
});
|
|
});
|