diff --git a/index-test.js b/index-test.js index 02b8607..92e7e96 100644 --- a/index-test.js +++ b/index-test.js @@ -62,6 +62,54 @@ describe('expect immutable', () => { it('does not throw when Lists are the same', () => { expect(Immutable.List([1])).toEqualImmutable(Immutable.List([1])); }); + + it('throws when Sets are different', () => { + expect(() => + expect(Immutable.Set([])).toEqualImmutable(Immutable.Set([1])) + ).toThrow( + 'Expected [] to equal [ 1 ]' + ); + }); + + it('does not throw when empty Sets are compared', () => { + expect(Immutable.Set([])).toEqualImmutable(Immutable.Set([])); + }); + + it('does not throw when Sets are the same', () => { + expect(Immutable.Set([1])).toEqualImmutable(Immutable.Set([1])); + }); + + it('throws when Seq.Indexed are different', () => { + expect(() => + expect(Immutable.Seq([])).toEqualImmutable(Immutable.Seq([1])) + ).toThrow( + 'Expected [] to equal [ 1 ]' + ); + }); + + it('does not throw when empty Seq.Indexed are compared', () => { + expect(Immutable.Seq([])).toEqualImmutable(Immutable.Seq([])); + }); + + it('does not throw when Seq.Indexed are the same', () => { + expect(Immutable.Seq([1])).toEqualImmutable(Immutable.Seq([1])); + }); + + it('throws when Seq.Indexed are different', () => { + expect(() => + expect(Immutable.Seq([])).toEqualImmutable(Immutable.Seq([1])) + ).toThrow( + 'Expected [] to equal [ 1 ]' + ); + }); + + it('does not throw when empty Seq.Indexed are compared', () => { + expect(Immutable.Seq([])).toEqualImmutable(Immutable.Seq([])); + }); + + it('does not throw when Seq.Indexed are the same', () => { + expect(Immutable.Seq([1])).toEqualImmutable(Immutable.Seq([1])); + }); }); context('toNotEqualImmutable', () => { @@ -104,5 +152,29 @@ describe('expect immutable', () => { 'Expected [ 1 ] to not equal [ 1 ]' ); }); + + it('does not throw when Sets are different', () => { + expect(Immutable.Set([1])).toNotEqualImmutable(Immutable.Set([])); + }); + + it('throws when Sets are the same', () => { + expect(() => + expect(Immutable.Set([1])).toNotEqualImmutable(Immutable.Set([1])) + ).toThrow( + 'Expected [ 1 ] to not equal [ 1 ]' + ); + }); + + it('does not throw when Seq.Indexed are different', () => { + expect(Immutable.Seq([1])).toNotEqualImmutable(Immutable.Seq([])); + }); + + it('throws when Seq.Indexed are the same', () => { + expect(() => + expect(Immutable.Seq([1])).toNotEqualImmutable(Immutable.Seq([1])) + ).toThrow( + 'Expected [ 1 ] to not equal [ 1 ]' + ); + }); }); });