Skip to main content
Module

x/unitest/mod.ts>trim

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

Use .trim to removes the leading and trailing white space and line terminator characters from a actual.

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

const expect = defineExpect({
  matcherMap: {
    toBe,
  },
  modifierMap: {
    trim,
  },
});

test("passes when trimmed string to be", () => {
  expect("  hello world  ").trim.toBe("hello world");
});