deno.land / std@0.166.0 / dotenv / util_test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "../testing/asserts.ts";import { difference, removeEmptyValues } from "./util.ts";
Deno.test("removeEmptyValuesTest", () => { const actual = removeEmptyValues({ a: true, b: false, c: null, d: "hi", e: "", f: 0, }); const expected = { a: true, b: false, d: "hi", f: 0, };
assertEquals(actual, expected, "removes null, undefined, and false");});
Deno.test("differenceTest", () => { const actual = difference(["a", "b", "c"], ["b", "c", "d"]); const expected = ["a"]; assertEquals( actual, expected, "returns an array of elements in list1 that are not in list2", );});
std

Version Info

Tagged at
a year ago