metarhia / jstp

Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
https://metarhia.github.io/jstp
Other
143 stars 10 forks source link

Improper testing of NaN values #202

Closed belochub closed 7 years ago

belochub commented 7 years ago

At the moment json5 tests include testing for correct NaN value parsing, but this tests check NaN value equality using strictSame comparison, which does not work with NaN values. isNaN function has to be used instead.

nechaido commented 7 years ago

At the point I have only one solution - writing custom function, that well check for deep equality: deepEqual(value, expected) and test if it returns true: test.assert(deepEqual(jstp.parse(value), expected)

@metarhia/jstp what do you think?

nechaido commented 7 years ago

I say the best solution is: npm install -save-dev lodash.isequal