Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Commit

Permalink
test(relaxed): add tests for relaxed parsing of certain types
Browse files Browse the repository at this point in the history
NODE-1397
  • Loading branch information
mbroadst committed Apr 1, 2018
1 parent ac52ae5 commit 5e9fd41
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/extend_mongodb_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ describe('Extended JSON', function() {
extJSON.parse({}, { strict: true });
}).to.throw;
});

it('should allow relaxed parsing', function() {
const inputObject = {
int: { $numberInt: '500' },
long: { $numberLong: '42' },
double: { $numberDouble: '24' }
};

const parsed = extJSON.parse(JSON.stringify(inputObject), { relaxed: true });
expect(parsed).to.eql({
int: 500,
long: 42,
double: 24
});
});
});
});
});

0 comments on commit 5e9fd41

Please sign in to comment.