Building Enterprise JavaScript Applications
上QQ阅读APP看书,第一时间看更新

Validating our payload

So far, we've been writing tests that ensure our request is valid and well-formed; in other words, making sure they are syntactically correct. Next, we are going to shift our focus to writing test cases that look at the payload object itself, ensuring that the payload has the correct structure and that it is semantically correct.