rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
17 lines (15 loc) • 427 B
text/typescript
import { arrayInsertAtIndex } from "./array-insert-at-index.js";
import { Test_setDefaultFlags } from "../../test-util/test_set-default-flags.js";
describe("=> arrayInsertAtIndex", () =>
{
beforeEach(() =>
{
Test_setDefaultFlags();
});
it("| returns the expected index", () =>
{
const a = [1, 2, 3];
arrayInsertAtIndex(a, 5, 1);
expect(a).toEqual([1, 5, 2, 3]);
});
});