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

@@ -9,10 +9,37 @@ const createCacheEntry = require("../helpers/createCacheEntry");
const popularShowsSuccess = require("../fixtures/popular-show-success-response.json");
const should = chai.should();
it('should return 200 with the information', () =>
request(app)
.get('/api/v2/show/popular')
.expect(200)
.then(response => assert.equal(response.body.results.length, 20))
);
chai.use(chaiHttp);
// describe("system test", () => {
// it("should run", () => {
// assert.equal(1, 1);
// });
// });
describe("As a user I want to get popular shows", () => {
beforeEach(() => resetDatabase());
beforeEach(() => createCacheEntry("pt:1", popularShowsSuccess));
it("should return 200 with the information", done => {
chai
.request(server)
.get("/api/v2/show/popular")
.end((error, response) => {
response.should.have.status(200);
done();
});
// done();
});
// .end((err, res) => {
// // res.should.have.status(200);
// // res.body?.results?.should.be.a("array");
// // res.body?.results?.length.should.be.eq(20);
// done();
// }));
// .expect(200));
// .then(response => {
// assert.equal(response.body?.results?.length, 20);
// }));
});