Skip to content

Commit

Permalink
Merge pull request #233 from boostcampwm-2022/feat/test
Browse files Browse the repository at this point in the history
ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง + ์œ ์ € ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€
  • Loading branch information
pushedrumex authored Dec 12, 2022
2 parents d9a32e2 + 6c7d693 commit c727af7
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 150 deletions.
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json --forceExit --verbose=false"
"test:e2e": "jest --config ./test/jest-e2e.json --forceExit --verbose=false",
"test:e2e-silent": "jest --config ./test/jest-e2e.json --forceExit --silent=false"
},
"dependencies": {
"@nestjs/axios": "^1.0.0",
Expand Down
310 changes: 161 additions & 149 deletions server/test/app.e2e-spec.ts

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions server/test/data/expectedData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export const expectedCourseData = {
id: 1,
title: "test example",
path: [
{ lat: 1, lng: 2 },
{ lat: 2, lng: 3 },
],
pathLength: 300,
userId: "June1010",
hDong: {
name: "์„œ์šธํŠน๋ณ„์‹œ",
},
};

export const expectedRecruitData = {
id: 1,
title: "test example",
startTime: "2037-12-29T15:00:00.000Z",
maxPpl: 1,
currentPpl: 1,
userId: "June1010",
pace: 300,
};
40 changes: 40 additions & 0 deletions server/test/data/mockData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export const mockCourse = (title: string) => {
return {
title: title,
path: [
{ lat: 1, lng: 2 },
{ lat: 2, lng: 3 },
],
pathLength: 300,
hCode: "1100000000",
};
};

export const mockRecruit = {
title: "test example",
startTime: new Date(2037, 11, 30).toISOString(),
maxPpl: 5,
pace: 300,
courseId: 1,
};

export const mockUserNoEmail = (id: string) => {
return {
userId: id,
password: "1234567890",
pace: 300,
hCode: "1100000000",
email: "[email protected]",
receiveMail: false,
};
};

export const mockAxiosResponse = (statusCode: number) => {
return {
data: {},
headers: {},
config: {},
statusText: "OK",
status: statusCode,
};
};
6 changes: 6 additions & 0 deletions server/test/data/requestData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const requestRecruitMockData = {
title: "test example",
startTime: new Date(2037, 11, 30).toISOString(),
maxPpl: 1, //ALERT, MAXPPL = 1
pace: 300,
};
Empty file added server/test/helpers/users.ts
Empty file.
Empty file.
Empty file.

0 comments on commit c727af7

Please sign in to comment.