1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
denoland-deno/std/util/deep_assign_test.ts
Bartek Iwańczuk 8feb30e325
BREAKING: remove overload of Deno.test() (#4951)
This commit removes overload of Deno.test() that accepted named
function.
2020-04-28 12:33:09 +02:00

24 lines
837 B
TypeScript

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
const { test } = Deno;
import { assertEquals, assert } from "../testing/asserts.ts";
import { deepAssign } from "./deep_assign.ts";
test("deepAssignTest", function (): void {
const date = new Date("1979-05-27T07:32:00Z");
const reg = RegExp(/DENOWOWO/);
const obj1 = { deno: { bar: { deno: ["is", "not", "node"] } } };
const obj2 = { foo: { deno: date } };
const obj3 = { foo: { bar: "deno" }, reg: reg };
const actual = deepAssign(obj1, obj2, obj3);
const expected = {
foo: {
deno: new Date("1979-05-27T07:32:00Z"),
bar: "deno",
},
deno: { bar: { deno: ["is", "not", "node"] } },
reg: RegExp(/DENOWOWO/),
};
assert(date !== expected.foo.deno);
assert(reg !== expected.reg);
assertEquals(actual, expected);
});