Skip to main content
Module

x/unitest/mod.ts>toBeArray

🃏 Deno-first universal unit testing framework
Latest
function toBeArray
Re-export
import { toBeArray } from "https://deno.land/x/unitest@v1.0.0-beta.82/mod.ts";

Use .toBeArray when checking if a value is an Array

import {
  defineExpect,
  not,
  test,
  toBeArray,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";

const expect = defineExpect({
  matcherMap: {
    toBeArray,
  },
  modifierMap: {
    not,
  },
});

test("passes when value is an array", () => {
  expect([]).toBeArray();
  expect([1]).toBeArray();
  expect(true).not.toBeArray();
});

Parameters

actual: unknown