-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add util tests Minor QOL improvement in link wallet where the sign-in link is also sent to the user so they can click on it instead of having to scan the QR code.
- Loading branch information
1 parent
82bbe5b
commit 0d6f21e
Showing
80 changed files
with
1,956 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ jobs: | |
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run build | ||
- run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"name": "vscode-jest-tests.v2", | ||
"request": "launch", | ||
"args": [ | ||
"--runInBand", | ||
"--watchAll=false", | ||
"--testNamePattern", | ||
"${jest.testNamePattern}", | ||
"--runTestsByPath", | ||
"${jest.testFile}" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
"disableOptimisticBPs": true, | ||
"program": "${workspaceFolder}/node_modules/.bin/jest", | ||
"windows": { | ||
"program": "${workspaceFolder}/node_modules/jest/bin/jest" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import about from './about'; | ||
import { Message } from 'discord.js'; | ||
|
||
describe('about command logic', () => { | ||
let message: Message; | ||
let payload: any; | ||
|
||
beforeEach(() => { | ||
message = { | ||
author: { id: '123' }, | ||
content: 'about', | ||
reply: jest.fn(), | ||
} as unknown as Message; | ||
|
||
payload = { | ||
handled: false, | ||
message, | ||
messageLowered: 'about', | ||
}; | ||
}); | ||
|
||
afterEach(() => { | ||
jest.resetAllMocks(); | ||
}); | ||
|
||
it('calls message.reply when payload.handled is false', async () => { | ||
payload.handled = false; | ||
|
||
await about(payload); | ||
|
||
expect(message.reply).toHaveBeenCalled(); | ||
}); | ||
|
||
it('does not reply when payload.handled is true', async () => { | ||
payload.handled = true; | ||
|
||
await about(payload); | ||
|
||
expect(message.reply).not.toHaveBeenCalled(); | ||
}); | ||
|
||
it('Responds to command with detail message', async () => { | ||
const reply = `Based on the open-source bot https://ohonesix.com/xrpl-discord-bot which is available freely here https://github.com/jacobpretorius/XRPL-Discord-Bot`; | ||
|
||
await about(payload); | ||
expect(message.reply).toHaveBeenCalledWith(reply); | ||
}); | ||
}); |
Oops, something went wrong.