-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove global node-fetch mock. #14297
Conversation
@@ -75,14 +84,9 @@ export async function create(ctx: any) { | |||
const doc = await pro.plugins.storePlugin(metadata, directory, source) | |||
|
|||
clientAppSocket?.emit("plugins-update", { name, hash: doc.hash }) | |||
ctx.body = { |
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.
Nice find!
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.
It fell out after I typed the response object.
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.
LGTM! Very nice!
@@ -75,14 +84,9 @@ export async function create(ctx: any) { | |||
const doc = await pro.plugins.storePlugin(metadata, directory, source) | |||
|
|||
clientAppSocket?.emit("plugins-update", { name, hash: doc.hash }) | |||
ctx.body = { |
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.
😅
await config.api.application.delete(app.appId) | ||
expect(events.app.deleted).toHaveBeenCalledTimes(1) | ||
expect(events.app.unpublished).toHaveBeenCalledTimes(1) | ||
}) | ||
|
||
it("should delete published app and dev app with prod app ID", async () => { | ||
await config.api.application.delete(app.appId.replace("_dev", "")) | ||
const prodAppId = app.appId.replace("_dev", "") |
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.
Is this part of the test? It looks like all the tests are doing the same, probably are part of the setup instead
Description
This PR removes the global
__mocks__/node-fetch.ts
file inpackages/server
in favour of usingnock
where needed.Additionally I've set up
nock
to disallow any requests to the internet outside of localhost.