Files
discordeno/packages/utils/tests/validateLength.spec.ts
Jonathan Ho eaf8782d34 test: fix rest and utils test (#2723)
* test(utils): fix  cant import collection

* test(rest): await expect

* fix(utils): deno compactability

* test(utils): typing

* fix(utils): add return type
2023-01-15 11:04:20 -06:00

31 lines
977 B
TypeScript

import { expect } from 'chai'
import { describe, it } from 'mocha'
// import { validateLength } from '../src/validateLength.js'
let validateLength: any
describe.skip(' ', () => {
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)
})
})