Skip to main content
Module

x/unitest/mod.ts>anyArray

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

matches any array or any specific array

import {
  anyArray,
  anyString,
  expect,
  test,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";

test("should be any array", () => {
  expect({ students: ["Alice", "Bob", "John"] }).toEqual({
    students: anyArray(),
  });
});

test("should be any string array", () => {
  expect({ students: ["Alice", "Bob", "John"] }).toEqual({
    students: anyArray(anyString()),
  });
});

Parameters

optional
expected: unknown

Returns

AnyArray