Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/unitest/modifier/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/modifier/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");
});