-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(rest:manager): don't use client for options
Signed-off-by: Splatterxl <splatterxl@outlook.ie>
- Loading branch information
1 parent
bd30819
commit 5fd1fe2
Showing
7 changed files
with
110 additions
and
43 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
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,33 @@ | ||
const REST = require('..'); | ||
const assert = require('assert'); | ||
|
||
const manager = new REST.default( | ||
new REST.RESTClient(REST.DefaultDiscordOptions), | ||
{ | ||
timings: true, | ||
logger: { | ||
debug: console.log, | ||
trace: console.log, | ||
kleur: null | ||
} | ||
} | ||
); | ||
|
||
manager.client.setAuth(process.env.DISCORD_TOKEN); | ||
|
||
assert.strictEqual(manager.client.getAuth(), process.env.DISCORD_TOKEN); | ||
assert.strictEqual(manager.client.baseURL, REST.DefaultDiscordOptions.baseURL); | ||
assert.strictEqual( | ||
manager.client.options.userAgent, | ||
REST.DefaultDiscordOptions.userAgent, | ||
); | ||
assert.strictEqual(manager.client.version, REST.DefaultDiscordOptions.version); | ||
|
||
manager | ||
.queue('/gateway') | ||
.then(res => res.body.json()) | ||
.then(json => { | ||
assert.deepStrictEqual(json, { | ||
url: 'wss://gateway.discord.gg', | ||
}); | ||
}); |
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