mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
BREAKING CHANGE: Builders no longer exports a `embedLength` function. Import it from `@discordjs/util` instead. Co-authored-by: Danial Raza <danialrazafb@gmail.com> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
21 lines
613 B
TypeScript
21 lines
613 B
TypeScript
import { describe, expect, test } from 'vitest';
|
|
import { embedLength } from '../src/functions/embedLength.js';
|
|
|
|
describe('embedLength', () => {
|
|
test('GIVEN an embed with specific amount of characters THEN returns amount of characters', () => {
|
|
const embed = {
|
|
title: 'yeet',
|
|
description: 'yeet',
|
|
fields: [{ name: 'yeet', value: 'yeet' }],
|
|
author: { name: 'yeet' },
|
|
footer: { text: 'yeet' },
|
|
};
|
|
|
|
expect(embedLength(embed)).toEqual('yeet'.length * 6);
|
|
});
|
|
|
|
test('GIVEN an embed with zero characters THEN returns amount of characters', () => {
|
|
expect(embedLength({})).toEqual(0);
|
|
});
|
|
});
|