expressworks icon indicating copy to clipboard operation
expressworks copied to clipboard

JSON me: Official solution fails

Open JohnnyBizzel opened this issue 8 years ago • 1 comments

             ACTUAL                                 EXPECTED                

────────────────────────────────────────────────────────────────────────────────

"[" != "[{"title":"Express.js Guide","tags":["node.js","express.js"],"url":"http://expressjsguide.com"},{"title":"Rapid Prototyping with JS","tags":["backbone.js","node.js","mongodb"],"url":"http://rpjs.co"},{"title":"JavaScript: The Good Parts","tags":["javascript"]}]" " "title": "Express.js Guide"," !=
" "tags": [" !=
" "node.js"," !=
" "express.js"" !=
" ]," !=
" "url": "http://expressjsguide.com"" !=
" }," !=
" {" !=
" "title": "Rapid Prototyping with JS"," !=
" "tags": [" !=
" "backbone.js"," !=
" "node.js"," !=
" "mongodb"" !=
" ]," !=
" "url": "http://rpjs.co"" !=
" }," !=
" {" !=
" "title": "JavaScript: The Good Parts"," !=
" "tags": [" !=
" "javascript"" !=
" ]" !=
" }" !=
"]" !=

JohnnyBizzel avatar Nov 14 '16 00:11 JohnnyBizzel

For those interested, the work around is to change the res.json(obj) to res.end(JSON.stringify(obj));

the result is a string without the formatting which causes the test case to fail.

Ethicmeta avatar Apr 19 '17 16:04 Ethicmeta