mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
* Add type helpers for typeLevel based desired props This also fixes / added a few stuff that was missing in exiting types & transformers, however due to this a few transformers got a breaking change due to the need to pass down the shardId * Fix benchmark type error * Add the generics to createBot / Bot / .. This caused a lot of breaking changed due to the required generics on a bunch of types * Fix benchmark type error? * Fix benchmarks type error * Fix E2E test type error * remove defaultDesiredPropertiesValue * Remove `internal` jsdoc from CompleteDesiredProprieties * Add tests for createDesiredPropertiesObject * Fix interaction.bot type * Remove Capitalize type helper It is already built-in into typescript as an intrinsic * Fix typo * Update message on missing desired properties * Fix CI * Move infer types to 'transformers.$inferredTypes' * Fix CI * Fix CI, again * Use GatewayHandlers in params of create function * change default behavior to remove key * Fix CI * fix types for e2e test
25 lines
682 B
TypeScript
25 lines
682 B
TypeScript
import { expect } from 'chai'
|
|
import { describe, it } from 'mocha'
|
|
import { createDesiredPropertiesObject } from '../../src/index.js'
|
|
|
|
describe('desired properties', () => {
|
|
it('fills defaults', () => {
|
|
const desired = createDesiredPropertiesObject({})
|
|
|
|
expect(desired.channel.id).to.be.equal(false)
|
|
})
|
|
|
|
it('respects config', () => {
|
|
const desired = createDesiredPropertiesObject({ channel: { id: true } })
|
|
|
|
expect(desired.channel.id).to.be.equal(true)
|
|
expect(desired.guild.id).to.be.equal(false)
|
|
})
|
|
|
|
it('can change default', () => {
|
|
const desired = createDesiredPropertiesObject({}, true)
|
|
|
|
expect(desired.channel.id).to.be.equal(true)
|
|
})
|
|
})
|