-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Upgrade more services to Angular 8 #7145
Changes from 1 commit
13424bf
5c8bec3
3b51282
3ae97e8
7f22747
ffa8a7e
952d5c0
41987d5
9990fe5
027340d
cc0ec34
906fd76
5b56005
1502ad2
f3a0997
5e96b0f
6f906ef
feb8a4c
56f61f0
64f9fea
69681da
04d7091
727a6bf
abb470f
d8e573b
6fa6c50
0ca2eae
5c75b38
0e557bf
dff56fd
e26e464
aa5133d
951982b
de7d2ad
ce5cec8
b5c2ef9
b6f243f
3df1a3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
* @fileoverview Unit tests for generic services. | ||
*/ | ||
|
||
// TODO(YashJipkate) Remove the unnnecessary imports once the corresponding | ||
// non-spec file is upgraded. | ||
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand why these need to be added here. They don't seem to be used in the test? There should probably be documentation somewhere to explain -- either here if it's specific to this, or in our wiki if it's a general principle to follow. In any case I think it would be nice to add a comment above line 25 explaining why lines 26-29 are needed. Do the same in all other similar files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not specific to this file, this is the case in many files. What's happening is that since we do not use isolated tests, these spec files depended upon the upgraded services and therefore angular mock could not interpret them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this something that would be removed after the full migration to Angular 8? If so, we should add a TODO to remove them in the future, like Vojta did for some of the webpack requires. I realize that that might be repetitive, but we should do that anyway to make clear that this isn't a long-term practice to be followed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The statements can be removed once the corresponding non-spec file is upgraded. |
||
import { WrittenTranslationObjectFactory } from | ||
'domain/exploration/WrittenTranslationObjectFactory.ts'; | ||
|
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.
In your TODOs here and elsewhere, be more specific: it's not clear which imports are "unnecessary" and which are not. It is also not clear which "non-spec file" is being referred to.
Please say something like "Remove the following two imports" and also specify the non-spec files explicitly. Also say "upgraded to Angular 8" rather than just "upgraded".
In general, TODOs should be really specific.
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.
I was thinking more like having a block notation like we have for webpack requires, and separate the 'needed' imports from the unneeded ones by a newline. At this point of time there is no 'needed' import (in the files not upgraded), since the imports arise only because of the Angular 8 dependency.
Also, the 'unnecessary' imports are only required in spec files, so the corresponding non-spec file refers to the file that's test resides in that spec file, should I name something more appropriate or should I explicitly lay out the name of the file?
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.
If you go with a block notation, there should be a comment at the end of the block denoting the "end" of the "unnecessary" imports.
Also, please explicitly lay out the name of the file. It's unclear whether "corresponding" refers to the file we're in, or the file that's being imported, or something else.
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.
Done!