Welcome to the Linux Foundation Forum!

CH-9 LABS 2 - Validate.js response of POST route '/' of id defined as integer fails

In the lab-2 of the chapter 9. The test checking POST route http://.../boat I think is not clear, because validate.js expect a string. This gives an error running $node validate.js.
The reason is on LINE 168 assert.deepEqual(result, { id: '3' }, ...
This is confusing, because id should be an integer. In fact, id as parameters are considered integers to pass other checks.

So, to pass this check you have to change validate.js in that line to id: 3 or in the post JSON Schema indicate that route response send the id as string.

Categories

Upcoming Training