mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: test coverage change with few test
This commit is contained in:
@@ -40,6 +40,36 @@ describe('[rest] Message related tests', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Managing reactions', async () => {
|
||||
it('Should add a unicode reaction', async () => {
|
||||
const message = await rest.sendMessage('1041029705790402611', { content: 'testing rate limit manager' })
|
||||
|
||||
await rest.addReaction(message.channelId, message.id, '📙')
|
||||
const reacted = await rest.getMessage(message.channelId, message.id)
|
||||
expect(reacted.reactions?.length).to.be.greaterThanOrEqual(1)
|
||||
|
||||
it('Should delete a unicode reaction', async () => {
|
||||
await rest.deleteOwnReaction(message.channelId, message.id, '📙')
|
||||
const reacted = await rest.getMessage(message.channelId, message.id)
|
||||
expect(reacted.reactions?.length).to.be.equal(0)
|
||||
})
|
||||
})
|
||||
|
||||
// it('Should add a custom reaction', async () => {
|
||||
// const message = await rest.sendMessage('1041029705790402611', { content: 'testing rate limit manager' })
|
||||
|
||||
// await rest.addReaction(message.channelId, message.id, '<:discordeno:785403373817823272>')
|
||||
// const reacted = await rest.getMessage(message.channelId, message.id)
|
||||
// expect(reacted.reactions?.length).to.be.greaterThanOrEqual(1)
|
||||
|
||||
// it('Should delete a custom reaction', async () => {
|
||||
// await rest.deleteOwnReaction(message.channelId, message.id, '<:discordeno:785403373817823272>')
|
||||
// const reacted = await rest.getMessage(message.channelId, message.id)
|
||||
// expect(reacted.reactions?.length).to.be.equal(0)
|
||||
// })
|
||||
// })
|
||||
})
|
||||
|
||||
describe('Rate limit manager testing', () => {
|
||||
it('Send 10 messages to 1 channel', async () => {
|
||||
await Promise.all(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { expect } from 'chai'
|
||||
import { afterEach, beforeEach, describe, it } from 'mocha'
|
||||
import sinon from 'sinon'
|
||||
import type { RestManager } from '../../src/types.js'
|
||||
import { createRestManager } from '../../src/manager.js'
|
||||
import type { RestManager } from '../../src/types.js'
|
||||
import { fakeToken as token } from '../constants.js'
|
||||
|
||||
describe('[rest] manager', () => {
|
||||
@@ -34,6 +34,15 @@ describe('[rest] manager', () => {
|
||||
it('With a base url', () => {
|
||||
expect(rest.baseUrl).to.be.equal(options.baseUrl)
|
||||
})
|
||||
|
||||
it('With a falsy token', () => {
|
||||
expect(() => createRestManager({ token: '' })).throws()
|
||||
})
|
||||
|
||||
it('With an application id', () => {
|
||||
const subrest = createRestManager({ ...options, applicationId: '130136895395987456' })
|
||||
expect(subrest.applicationId).to.be.equal(130136895395987456n)
|
||||
})
|
||||
})
|
||||
|
||||
describe('rest.simplifyUrl', () => {
|
||||
|
||||
Reference in New Issue
Block a user