Skip to content

Commit

Permalink
Wrote test to check filtering of stack deserialisation.
Browse files Browse the repository at this point in the history
  • Loading branch information
crstim committed Aug 30, 2017
1 parent 01622d3 commit d8da0e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ describe('transit', function() {
expect(result.size).to.eql(3);
});

it('can ignore Stack entries', function() {
var input = Immutable.Stack.of(1, 2, 3, 'a');
filter = transit.withFilter(function(val) {
return typeof val === 'number';
});
var result = filter.fromJSON(filter.toJSON(input));
expect(result.includes('a')).to.eql(false);
expect(result.size).to.eql(3);
});

it('can ignore OrderedSet entries', function() {
var input = Immutable.Set.of(1, 2, 3, 3, 'a');
filter = transit.withFilter(function(val) {
Expand Down

0 comments on commit d8da0e9

Please sign in to comment.