-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/ode 57 create info service #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
duynguyenod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge vào integration, không phải master, chưa rebase
d47bd11 to
f4e8206
Compare
duynguyenod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Toàn bộ test em viết đang là integration test, vì nó có can thiệp đến model.
Unit test em phải mock cái model nha. Add thêm nhá, mấy cái exist thì vẫn là unit test.
Những task khác, nếu có integration test thì tốt nhưng không bắt buôcj, có thể thêm sau, nhưng unit test là phải có nha e.
|
Em có thể coi những file khác trong unit test để tham khảo nha |
src/services/info.service.js
Outdated
| import { assignIn } from 'lodash'; | ||
| import InfoModel from '../models/info.model'; | ||
|
|
||
| exports.create = async (any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nếu như input data là any thì e đã test vs trường hợp {
key: 'ahihi',
balabbaxam: ''
}
Như này thì nó vẫn có lỗi ko?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cái này sẽ không có lỗi ạ, chỉ ko lưu cái kia vào thôi a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Em viết UnitTest nhưng đây là Integration test rồi, unit test thì em sẽ phải mock toàn bộ các function liên quan tới mongoose, để test service logic. Và có 1 lỗi coverage kìa.
d53e514 to
d3ecf0c
Compare
d3ecf0c to
5a8b6fc
Compare
change folder fix path import add test add more test edit some problems edit test edit test update test
5a8b6fc to
d036954
Compare
No description provided.