1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
letu/test/test-pages.js
2020-10-06 13:28:53 +02:00

33 lines
675 B
JavaScript

let request = require("supertest");
let wipeDatabase = require("./utils/wipeDatabase");
async function setup() {
let app = require("../app");
let models = require("../models");
await models.sequelize.sync();
await wipeDatabase(models);
return [app, models];
}
async function clean() {
await wipeDatabase(models);
await models.sequelize.close();
for (let e of ["../app", "../models"])
delete require.cache[require.resolve(e)];
}
before(async () => {
[app, models] = await setup();
})
it("Main page content", async () => {
await request(app)
.get("/")
.expect(200);
});
after(() => {
return clean;
});