-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fix #3576 import redirects. Replace native-request with needle. #3582
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@import "https://example.com/redirect.less"; | ||
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 will always redirect? As in, will this test always succeed with this remote endpoint? 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 the url 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. Ah, perfect. |
||
|
||
h1 { color: red; } |
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 remote imports are being broken between tests, where do you think would be the best place to fix this? Is this a problem in Less itself? Or a problem in the way tests are set up?
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 think the problem is in the way tests are set up. Ideally tests should be independent, meaning each test should have it's own instance of
less
, even more so since theless
instance is modified by some tests. Or, alternatively, each test should have a tear down part, where it returnsless
instance to it's initial (before test) state. However, if I understand correctly tests are also run concurrently, which might be a problem for the set up / tear down approach.I suspect the reason remote imports get broken is because of plugin tests, might be wrong here, haven't actually investigated it.
One way to approach this is to define a function with contents of
less-node/index.js
and call it inless-node/index.js
and before each test.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 don't believe tests are run concurrently. They're run in a queue. But definitely it's possible they mutate the less object or don't return it to previous state. However, I doubt that's intentional, so it would be great to track it down, but maybe that's out of the scope of this issue.