Skip to main content
Module

x/unitest/mod.ts>toBeString

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

Use .toBeString when checking if a value is a string

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

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

test("passes when value is a string", () => {
  expect("").toBeString();
  expect("hello").toBeString();
  expect(new String("hello")).not.toBeString();
});

Parameters

actual: unknown