Skip to content

Commit ed9ae57

Browse files
committed
Add unit tests for CoursesCounter module
1 parent 71b8f3a commit ed9ae57

File tree

55 files changed

+3614
-3695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3614
-3695
lines changed

package-lock.json

Lines changed: 3267 additions & 3582 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,52 +18,52 @@
1818
"build:clean": "rm -r dist; exit 0"
1919
},
2020
"dependencies": {
21-
"@types/bson": "^4.0.0",
22-
"@types/compression": "^1.0.1",
21+
"@types/bson": "^4.0.2",
22+
"@types/compression": "^1.7.0",
2323
"@types/convict": "^4.2.1",
24-
"@types/errorhandler": "0.0.32",
25-
"@types/express": "^4.17.2",
24+
"@types/errorhandler": "1.5.0",
25+
"@types/express": "^4.17.3",
2626
"@types/glob": "^7.1.1",
27-
"@types/helmet": "0.0.44",
28-
"@types/mongodb": "^3.3.15",
29-
"@types/node": "~13.1.1",
30-
"@types/uuid": "^3.4.6",
27+
"@types/helmet": "0.0.45",
28+
"@types/mongodb": "^3.5.4",
29+
"@types/node": "^13.9.4",
30+
"@types/uuid": "^7.0.2",
3131
"@types/uuid-validate": "0.0.1",
3232
"body-parser": "^1.19.0",
33-
"bson": "^4.0.2",
33+
"bson": "^4.0.4",
3434
"compression": "^1.7.4",
35-
"convict": "^5.1.0",
35+
"convict": "^5.2.0",
3636
"copy": "^0.3.2",
3737
"errorhandler": "^1.5.1",
3838
"express": "^4.17.1",
3939
"glob": "^7.1.6",
40-
"helmet": "^3.21.2",
40+
"helmet": "^3.22.0",
4141
"http-status": "^1.4.2",
4242
"mandrill-api": "^1.0.45",
43-
"mongodb": "^3.5.2",
44-
"node-dependency-injection": "^2.4.2",
45-
"ts-node": "^8.3.0",
46-
"typescript": "^3.7.2",
47-
"uuid": "^3.3.3",
43+
"mongodb": "^3.5.5",
44+
"node-dependency-injection": "^2.6.2",
45+
"ts-node": "^8.8.1",
46+
"typescript": "^3.8.3",
47+
"uuid": "^7.0.2",
4848
"uuid-validate": "0.0.3",
4949
"winston": "^3.2.1"
5050
},
5151
"devDependencies": {
52-
"@types/aws-lambda": "^8.10.31",
53-
"@types/cucumber": "^4.0.7",
54-
"@types/faker": "^4.1.5",
55-
"@types/jest": "^24.0.18",
52+
"@types/aws-lambda": "^8.10.46",
53+
"@types/cucumber": "^6.0.1",
54+
"@types/faker": "^4.1.11",
55+
"@types/jest": "^25.1.4",
5656
"@types/supertest": "^2.0.8",
5757
"cucumber": "^6.0.5",
5858
"faker": "^4.1.0",
59-
"husky": "^1.3.1",
60-
"jest": "^24.9.0",
61-
"lint-staged": "8.2.1",
62-
"prettier": "^1.16.4",
59+
"husky": "^4.2.3",
60+
"jest": "^25.2.3",
61+
"lint-staged": "10.0.9",
62+
"prettier": "^2.0.2",
6363
"supertest": "^4.0.2",
64-
"ts-jest": "^24.1.0",
65-
"ts-node-dev": "^1.0.0-pre.43",
66-
"tslint": "^5.20.1",
64+
"ts-jest": "^25.2.1",
65+
"ts-node-dev": "^1.0.0-pre.44",
66+
"tslint": "^6.1.0",
6767
"tslint-config-prettier": "~1.18.0",
6868
"tslint-eslint-rules": "^5.4.0"
6969
},

src/Contexts/Mooc/Courses/domain/Course.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ export class Course extends AggregateRoot {
3030
return course;
3131
}
3232

33-
static fromPrimitives(plainData: any): Course {
33+
static fromPrimitives(plainData: { id: string; name: string; duration: string }): Course {
3434
return new Course(
3535
new CourseId(plainData.id),
3636
new CourseName(plainData.name),
3737
new CourseDuration(plainData.duration)
3838
);
3939
}
4040

41-
toPrimitives(): any {
41+
toPrimitives() {
4242
return {
4343
id: this.id.value,
4444
name: this.name.value,
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)