-
Notifications
You must be signed in to change notification settings - Fork 56
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
Raised New PR : (https://github.com/Real-Dev-Squad/discord-slash-commands/pull/98) Added description to the message after using /verify #85 #90
base: develop
Are you sure you want to change the base?
Conversation
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.
Looks good enough for a merge 👍🏻
Where is the test of the changes? |
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.
Please add tests for it.
"@types/node": "^18.11.18", | ||
"@types/node-fetch": "^2.6.2", | ||
"@typescript-eslint/eslint-plugin": "^5.47.1", | ||
"@typescript-eslint/parser": "^5.47.1", | ||
"eslint": "^8.31.0", | ||
"jest": "^29.3.1", | ||
"jsonwebtoken": "^9.0.1", |
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.
Why are we installing the jsonwebToken package?
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.
to mock cloudfareworker jwt
@@ -0,0 +1,14 @@ | |||
"use strict"; | |||
import jsonwebtoken from "jsonwebtoken"; |
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.
why do we need this package? It is not being used anywhere so why are we mocking it?
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.
yes we did it afterwards
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.
check in latest commit
src/controllers/verifyCommand.ts
Outdated
|
||
const response = await sendUserDiscordData( | ||
token, | ||
const response = await sendUserDiscordData( token, |
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 there too much whitespace before token
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.
fixed automatically, via eslint
tests/mocks/__mocks__
Outdated
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.
Please remove this blank file
@@ -1,3 +1,4 @@ | |||
const crypto = require("crypto"); |
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.
We should not require crypto as it is available globally from node 18
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.
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.
but now te issue is, this require is not allowed but when I am using import it gives the same error:/
// const mockResponse = response.INTERNAL_SERVER_ERROR; | ||
// jest | ||
// .spyOn(global, "fetch") | ||
// .mockImplementation(() => | ||
// Promise.resolve(new JSONResponse(mockResponse)) | ||
// ); |
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.
Please remove the commented code
added |
Description
after using /verify command, the reply message is showing just a link.
Ticket : Added Description to the message after using /verify
Output: Not adding output as it consist of auth URL!
Adding TestCases of /verify feature !