Open bajtos opened 4 years ago
Hey, I'd like to work on this issue. Could you provide some more information?
Hi @rahil1304, thanks for offering your help! What kind of information are you looking for?
As for this issue in particular:
shot
(match case, match whole world in VSCode search) and update them accordingly. Files found by my search:
package.json
entries referring to @hapi/shot
should use light-my-way
instead, the docs should be updated similarly. light-my-way
ships TypeScript typings. If it does not, then we will need to add @types/light-my-way
too.package.json
file, please run npm install
to update the installed dependencies too.Unfortunately, we don't have tests for shot
inside testlab
, I think we rely on tests in other packages in the monorepo to verify the functionality. You can run npm test
in the monorepo root directory to verify that everything keeps working.
Last but not least, the commit message should annotate the change as breaking, see Making breaking changes in our developer docs.
Also feel free to ask for help in #loopback-contributors
channel, you can join our Slack workspace here.
Hey @bajtos I needed some help with the code in the shot.ts file.
import {
Listener as ShotListener,
RequestOptions as ShotRequestOptions,
ResponseObject,
} from 'shot';
So these are the particular libraries that are being used from @hapi/shot. Just confirming, I need to find the similar libraries that are being used in light-my-way, and accordingly replace it, right? The rest of the code in shot.ts stays the same, right?
Hey @bajtos I needed some help with the code in the shot.ts file.
import { Listener as ShotListener, RequestOptions as ShotRequestOptions, ResponseObject, } from 'shot';
So these are the particular libraries that are being used from @hapi/shot. Just confirming, I need to find the similar libraries that are being used in light-my-way, and accordingly replace it, right? The rest of the code in shot.ts stays the same, right?
Yes, that's correct.
I just realized that the issue title and description were referring to an incorrect module light-my-way
, which does not exist. The correct module name is light-my-request
, see https://www.npmjs.com/package/light-my-request.
Sorry for the confusion I created 🙈
AFAICT, light-my-request
provides InjectionOptions
instead of RequestOptions
(see light-my-request/index.d.ts#L31
), Response
instead of ResponseObject
(see light-my-request/index.d.ts#L73
. I am not sure what name they use instead of Listener
, perhaps DispatchFunc
?
hello, I would love to work on this
@blackpandan sure, please go ahead.
Hi there, if this Issue is still not resolved i would like to give it a shot!
Sure thing, @ConaGo! Feel free to ask queries here or on #loopback-contributors on Slack. The maintainers will try to help where possible.
Rework
@loopback/testlab
to uselight-my-request
for stubbing HTTP requests & responses.Arguments for the change:
light-my-request
has larger community of contributors (45 vs 24)light-my-request
has more activity (compare https://github.com/fastify/light-my-request/graphs/contributors?from=2020-01-01&to=2020-09-18&type=c to https://github.com/hapijs/shot/graphs/contributors?from=2020-01-01&to=2020-09-18&type=c)@hapi/shot
did not support all LTS versions of Node.js, we had to stay at an old major version. Nowadays they don't limit the supported versions viaengines.node
, but their CI is configured to test only on Node.js 12+.