Skip to content

Commit

Permalink
test: add empty objects
Browse files Browse the repository at this point in the history
  • Loading branch information
slikts committed Mar 1, 2020
1 parent db35e16 commit 553315b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/DeepCompositeSymbol.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ describe(DeepCompositeSymbol.name, () => {
expect(DeepCompositeSymbol(o1, filter)).toBe(DeepCompositeSymbol(o2, filter));
expect(DeepCompositeSymbol(o1)).not.toBe(DeepCompositeSymbol(o2));
});

it('works with empty objects', () => {
expect(DeepCompositeSymbol([])).toBe(DeepCompositeSymbol([]));
expect(DeepCompositeSymbol({})).toBe(DeepCompositeSymbol({}));
expect(DeepCompositeSymbol({})).not.toBe(DeepCompositeSymbol({ a: 1 }));
expect(DeepCompositeSymbol([])).not.toBe(DeepCompositeSymbol([1]));
});
});
7 changes: 7 additions & 0 deletions test/ValueObject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@ describe(ValueObject.name, () => {
expect(() => ValueObject(a)).toThrow();
expect(() => ValueObject(shallow(a))).not.toThrow();
});

it('works with empty objects', () => {
expect(ValueObject([])).toBe(ValueObject([]));
expect(ValueObject({})).toBe(ValueObject({}));
expect(ValueObject({})).not.toBe(ValueObject({ a: 1 }));
expect(ValueObject([])).not.toBe(ValueObject([1]));
});
});

0 comments on commit 553315b

Please sign in to comment.