Skip to content

Commit

Permalink
test: cloneDeep
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Faust committed Jan 11, 2019
1 parent 0c9d76c commit 5857874
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions __tests__/cloneDeep.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import "jest-extended";
import { cloneDeep } from "../src";

const dummies = [
{ name: "Andrew", age: 18 },
{ name: "Bob", age: 18 },
{ name: "John", age: 30 },
{ name: "Jane", age: 40 },
];

test("clones an array", () => {
expect(cloneDeep(dummies)).toEqual(dummies);
});

test("clones an object", () => {
expect(cloneDeep(dummies[0])).toEqual(dummies[0]);
});

0 comments on commit 5857874

Please sign in to comment.