You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(http): should throw an exception if input to http.request is not string or Request #4245
I forgot to import Request in an example where I instantiate Request manually, which meant I was instantiating the global Request object instead of Request provided by angular2/http. When passing this to Http.prototype.request, the input didn't match the string or instanceof Request check, so the method was returning `undefined. Instead, an exception should be raised.
@jeffbcross can you show me an example of how you instantiate the global Request object manually? I'm not sure how to do that in Typescript for my test.
@bkyarger what we could do instead of instantiating a global Request (which isn't present in all test environments) is just provide a value to the request function that isn't really a Request or string, but tell typescript that it is.
@jeffbcross I've got the change implemented with a test, but I'm having trouble getting the entire npm test suite to complete. When it launches firefox to perf tests FF is crashing (I think when installing the xpi) so the perf tests eventually time out. I'm on OSX and my FF is up to date. Any suggestions or workarounds?
@bkyarger If unit tests are passing, and if gulp check-format passes, I would just go ahead and open a PR and let Travis run the tests. If gulp check-format fails, it provides a script you can run to automatically clean up formatting.
Activity
jeffbcross commentedon Sep 18, 2015
Here's where the change should occur:
angular/modules/angular2/src/http/http.ts
Line 121 in 2acc1ad
bkyarger commentedon Sep 18, 2015
I'd like to tackle this one.
jeffbcross commentedon Sep 18, 2015
It's all you, @bkyarger! LMK if you need help writing/running unit tests.
bkyarger commentedon Sep 18, 2015
@jeffbcross can you show me an example of how you instantiate the global
Requestobject manually? I'm not sure how to do that in Typescript for my test.jeffbcross commentedon Sep 18, 2015
@bkyarger what we could do instead of instantiating a global
Request(which isn't present in all test environments) is just provide a value to the request function that isn't really aRequestor string, but tell typescript that it is.bkyarger commentedon Sep 18, 2015
Awesome, I'll do that. Thanks!
bkyarger commentedon Sep 18, 2015
@jeffbcross I've got the change implemented with a test, but I'm having trouble getting the entire
npm testsuite to complete. When it launches firefox to perf tests FF is crashing (I think when installing the xpi) so the perf tests eventually time out. I'm on OSX and my FF is up to date. Any suggestions or workarounds?jeffbcross commentedon Sep 18, 2015
@bkyarger If unit tests are passing, and if
gulp check-formatpasses, I would just go ahead and open a PR and let Travis run the tests. Ifgulp check-formatfails, it provides a script you can run to automatically clean up formatting.bkyarger commentedon Sep 18, 2015
Yep, both of those are passing. PR on the way. Thanks!
fix(http): throw if url is not string or Request
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.