mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
27 lines
847 B
TypeScript
27 lines
847 B
TypeScript
import { expect } from 'chai'
|
|
import { validateLength } from '../src/validateLength.js'
|
|
|
|
it('[utils] Validate length is too low', () => {
|
|
expect(validateLength('test', { min: 5 })).to.be.equal(false)
|
|
})
|
|
|
|
it('[utils] Validate length is too high', () => {
|
|
expect(validateLength('test', { max: 3 })).to.be.equal(false)
|
|
})
|
|
|
|
it('[utils] Validate length is NOT just right in between.', () => {
|
|
expect(validateLength('test', { min: 5, max: 3 })).to.be.equal(false)
|
|
})
|
|
|
|
it('[utils] Validate length is NOT too low', () => {
|
|
expect(validateLength('test', { min: 3 })).to.be.equal(true)
|
|
})
|
|
|
|
it('[utils] Validate length is NOT too high', () => {
|
|
expect(validateLength('test', { max: 5 })).to.be.equal(true)
|
|
})
|
|
|
|
it('[utils] Validate length is just right in between.', () => {
|
|
expect(validateLength('test', { min: 3, max: 6 })).to.be.equal(true)
|
|
})
|