Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions backend/models/project.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ const { Project } = require('./project.model');

const { setupDB } = require("../setup-test");

beforeAll(async () => {
await setupDB("user-model");
});
setupDB("user-model");

describe("Project Model saves the correct values", () => {
test("Save a model instance and then read from the db", async (done) => {
Expand Down
4 changes: 1 addition & 3 deletions backend/models/user.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ const { User } = require('./user.model');

const { setupDB } = require("../setup-test");

beforeAll(async () => {
await setupDB("user-model");
});
setupDB("user-model");

// Please add and expand on this simple test.
describe("Question Model saves the correct values", () => {
Expand Down
7 changes: 6 additions & 1 deletion backend/workers/createRecurringEvents.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
filterAndCreateEvents,
runTask,
scheduleTask,
} = require('./createRecurringEvents');
} = jest.requireActual('./createRecurringEvents');
const { generateEventData } = require('./lib/generateEventData');

const MockDate = require('mockdate');
Expand All @@ -29,6 +29,11 @@ describe('createRecurringEvents Module Tests', () => {
let mockEvents;
let mockRecurringEvents;

fetch.mockResolvedValue({
ok: true,
json: jest.fn().mockResolvedValue(mockEvents),
});

beforeEach(() => {
MockDate.set('2023-11-02T00:00:00Z');

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"test:cy": "dotenv -e ./backend/.env -e ./client/.env cross-var start-test dev:api %BACKEND_PORT% dev:client %CLIENT_PORT% cy:run",
"test:backend": "cd backend && npm run test",
"test:client": "cd client && npm run test",
"test:client-mvp": "cd client-mvp-04 && npm run test",
"test:all": "cross-env NODE_ENV=test npm run test:client && npm run test:client-mvp && npm run test:backend && npm run test:cy"
"test:all": "cross-env NODE_ENV=test npm run test:client && npm run test:backend"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Writing for clarity here that we're removing test:client-mvp and test:cy

},
"dependencies": {
"@mui/icons-material": "^5.14.19",
Expand Down
Loading