Skip to content

Commit dc54934

Browse files
committed
Merge branch 'develop' into ax/scrum-101-timetable-frontend
2 parents 5bda338 + 6f15fb9 commit dc54934

File tree

20 files changed

+11343
-1922
lines changed

20 files changed

+11343
-1922
lines changed

.github/workflows/testing.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run Tests
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Run frontend tests
9+
run: cd course-matrix/frontend && npm install && npm run test
10+
- name: Run backend tests
11+
run: cd course-matrix/backend && npm install && npm run test
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { describe, test, expect } from "@jest/globals";
2+
import request from "supertest";
3+
import app from "../src/index";
4+
5+
describe("Sum function", () => {
6+
test("Returns correct value", () => {
7+
expect(2 + 3).toEqual(5);
8+
});
9+
});
10+
11+
// Will finish the rest of the tests below in Sprint 3
12+
13+
// describe("GET /auth/session", () => {
14+
// test("It should respond with 200 status", async () => {
15+
// const response = await request(app).get("/auth/session");
16+
// expect(response.statusCode).toBe(200);
17+
// });
18+
// });
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { Config } from "jest";
2+
3+
const config: Config = {
4+
preset: "ts-jest",
5+
moduleNameMapper: {
6+
"\\.(css|scss)$": "identity-obj-proxy",
7+
"^.+\\.svg": "<rootDir>/tests/mocks/svgMock.tsx",
8+
},
9+
// to obtain access to the matchers.
10+
setupFilesAfterEnv: ["<rootDir>/tests/setupTests.ts"],
11+
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
12+
modulePaths: ["<rootDir>"],
13+
testEnvironment: "jsdom",
14+
transform: {
15+
"^.+\\.(ts|tsx)$": [
16+
"ts-jest",
17+
{
18+
tsconfig: "tsconfig.test.json",
19+
},
20+
],
21+
"^.+\\.(js|jsx)$": "babel-jest",
22+
},
23+
};
24+
25+
export default config;

0 commit comments

Comments
 (0)