How to compare the output of serializeArray using qunit

Posted by dorelal on Stack Overflow See other posts from Stack Overflow or by dorelal
Published on 2010-05-19T13:50:05Z Indexed on 2010/06/02 3:53 UTC
Read the original article Hit count: 328

Filed under:
|
|

I am using qunit and jquery. Latest version of both.

In my code when I submit the form I have the event as e. I call

e.serializeArray() 

Here is my test.

equals(args.data, [ { "name": "user_name", "value": "john" } ], 'input data');

And this is the error message from qunit.

expected: [ { "name": "user_name", "value": "david" } ] result: [ { "name": "user_name", "value": "david" } ]

As you can see to the naked eye the expected and result value is same but qunit is not liking it.

I guess I am missing something.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about testing