Files
discord.js/packages/util/__tests__/range.test.ts
Suneet Tipirneni b2ec865765 feat: add @discordjs/util (#8591)
* feat: add @discordjs/util

* fix: builders test

* refactor: make rest use lazy for ESM import

* chore: make requested changes

* Apply suggestions from code review

Co-authored-by: Parbez <imranbarbhuiya.fsd@gmail.com>
Co-authored-by: A. Román <kyradiscord@gmail.com>

* chore: make requested changes and add tests

* chore: regen lockfile

* test: add type tests

* chore: push missing files

* chore: make requested changes

* chore: update CI stuff

* chore: fix lockfile

* chore: make requested changes

Co-authored-by: Parbez <imranbarbhuiya.fsd@gmail.com>
Co-authored-by: A. Román <kyradiscord@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-10-02 18:00:31 +00:00

13 lines
377 B
TypeScript

import { describe, test, expect } from 'vitest';
import { range } from '../src/index.js';
describe('range', () => {
test('GIVEN valid range THEN valid array is returned', () => {
expect(range(0, 5)).toEqual([0, 1, 2, 3, 4, 5]);
});
test('GIVEN valid range with step THEN valid array is returned', () => {
expect(range(0, 10, 2)).toEqual([0, 2, 4, 6, 8, 10]);
});
});