Skip to content

Commit

Permalink
[CodeForPoznan#121] Temporary test solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciek246 committed Mar 4, 2020
1 parent 3a780a7 commit 5146bba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/fixtures/apply_schools.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { createSchool } = require("../../db/api");
const { schoolData } = require("../factories/schoolFactory");

const insertSchool = () => {
Array(10)
const insertSchool = numberOfSchools => {
Array(numberOfSchools || 10)
.fill(0)
.forEach(() => createSchool(schoolData()));
};
Expand Down
8 changes: 8 additions & 0 deletions src/test/models/school_model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ const { schoolData } = require("../factories/schoolFactory");
const { School } = require("../../db/models");

describe("School model", () => {
beforeAll(() => {
return sequelize
.sync({ force: true })
.then(() => schoolTypeFactory("mock"));
});

beforeEach(() => {
// I know, this is the same as code in `beforeAll` but
// this is temporary solution until problem with creating DB in tests should be resolved
return sequelize
.sync({ force: true })
.then(() => schoolTypeFactory("mock"));
Expand Down

0 comments on commit 5146bba

Please sign in to comment.