Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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 ]'
);
});
});
});