users - test › POST /
/ home / miguel / cursos / cursoJs - Node / proyectoMichaelgram / michaelgram - api / node_modules / request - promise - core / lib / errors . js : 32
Rejected promise returned by test . Reason :
StatusCodeError {
error : {
error : 'route not found' ,
} ,
message : '404 - {"error":"route not found"}' ,
name : 'StatusCodeError' ,
options : {
body : {
email : 'f@platzi.test' ,
name : 'Miguel Espeso' ,
password : 'pl4tzi' ,
username : 'miguelito' ,
} ,
callback : Function RP $callback { } ,
json : true ,
method : 'POST' ,
resolveWithFullResponse : true ,
simple : true ,
transform : undefined ,
transform2xxOnly : false ,
uri : 'http://localhost:43651' ,
} ,
response : IncomingMessage {
_consuming : false ,
_dumped : false ,
_events : {
close : Array [ … ] ,
data : Function { } ,
end : Array [ … ] ,
error : Function { } ,
} ,
_eventsCount : 4 ,
_maxListeners : undefined ,
_readableState : ReadableState [
awaitDrain : 0 ,
buffer : BufferList [ … ] ,
decoder : null ,
defaultEncoding : 'utf8' ,
destroyed : false ,
emitClose : true ,
emittedReadable : false ,
encoding : null ,
endEmitted : true ,
ended : true ,
flowing : true ,
highWaterMark : 16384 ,
length : 0 ,
needReadable : false ,
objectMode : false ,
pipes : null ,
pipesCount : 0 ,
readableListening : false ,
reading : false ,
readingMore : true ,
resumeScheduled : false ,
sync : true ,
] ,
aborted : false ,
body : {
error : 'route not found' ,
} ,
caseless : Caseless {
dict : Object { … } ,
} ,
client : Socket {
_events : Object { … } ,
_eventsCount : 7 ,
_hadError : false ,
_handle : TCP { … } ,
_host : 'localhost' ,
_httpMessage : ClientRequest { … } ,
_maxListeners : undefined ,
_parent : null ,
_pendingData : null ,
_pendingEncoding : '' ,
_readableState : ReadableState [ … ] ,
_server : null ,
_sockname : null ,
_writableState : WritableState [ … ] ,
allowHalfOpen : false ,
connecting : false ,
parser : null ,
readable : true ,
server : null ,
writable : false ,
[ Symbol ( asyncId ) ] : 11 ,
[ Symbol ( lastWriteQueueSize ) ] : 0 ,
[ Symbol ( timeout ) ] : null ,
[ Symbol ( kBytesRead ) ] : 0 ,
[ Symbol ( kBytesWritten ) ] : 0 ,
} ,
complete : true ,
connection : Socket {
_events : Object { … } ,
_eventsCount : 7 ,
_hadError : false ,
_handle : TCP { … } ,
_host : 'localhost' ,
_httpMessage : ClientRequest { … } ,
_maxListeners : undefined ,
_parent : null ,
_pendingData : null ,
_pendingEncoding : '' ,
_readableState : ReadableState [ … ] ,
_server : null ,
_sockname : null ,
_writableState : WritableState [ … ] ,
allowHalfOpen : false ,
connecting : false ,
parser : null ,
readable : true ,
server : null ,
writable : false ,
[ Symbol ( asyncId ) ] : 11 ,
[ Symbol ( lastWriteQueueSize ) ] : 0 ,
[ Symbol ( timeout ) ] : null ,
[ Symbol ( kBytesRead ) ] : 0 ,
[ Symbol ( kBytesWritten ) ] : 0 ,
} ,
headers : {
connection : 'close' ,
'content-length' : '27' ,
'content-type' : 'application/json; charset=utf-8' ,
date : 'Wed, 18 Jul 2018 23:41:22 GMT' ,
} ,
httpVersion : '1.1' ,
httpVersionMajor : 1 ,
httpVersionMinor : 1 ,
method : null ,
rawHeaders : [
'Content-Type' ,
'application/json; charset=utf-8' ,
'Content-Length' ,
'27' ,
'Date' ,
'Wed, 18 Jul 2018 23:41:22 GMT' ,
'Connection' ,
'close' ,
] ,
rawTrailers : [ ] ,
readable : false ,
req : ClientRequest {
_contentLength : null ,
_ended : true ,
_events : Object { … } ,
_eventsCount : 5 ,
_hasBody : true ,
_header : ` POST / HTTP/1.1ââŠ
host: localhost:43651ââŠ
accept: application/jsonââŠ
content-type: application/jsonââŠ
content-length: 91ââŠ
Connection: closeââŠ
ââŠ
` ,
_headerSent : true ,
_last : true ,
_maxListeners : undefined ,
_onPendingData : Function noopPendingOutput { } ,
_removedConnection : false ,
_removedContLen : false ,
_removedTE : false ,
_trailer : '' ,
aborted : undefined ,
agent : Agent { … } ,
chunkedEncoding : false ,
connection : Socket { … } ,
finished : true ,
maxHeadersCount : null ,
method : 'POST' ,
output : [ ] ,
outputCallbacks : [ ] ,
outputEncodings : [ ] ,
outputSize : 0 ,
parser : null ,
path : '/' ,
res : [ Circular ] ,
sendDate : false ,
shouldKeepAlive : false ,
socket : Socket { … } ,
socketPath : undefined ,
timeout : undefined ,
timeoutCb : null ,
upgradeOrConnect : false ,
useChunkedEncodingByDefault : true ,
writable : true ,
[ Symbol ( isCorked ) ] : false ,
[ Symbol ( outHeadersKey ) ] : Object { … } ,
} ,
request : Request {
__isRequestRequest : true ,
_auth : Auth { … } ,
_callback : Function RP $callback { } ,
_callbackCalled : true ,
_destdata : true ,
_disableCookies : true ,
_ended : true ,
_events : Object { … } ,
_eventsCount : 5 ,
_jar : undefined ,
_json : true ,
_maxListeners : undefined ,
_multipart : Multipart { … } ,
_oauth : OAuth { … } ,
_qs : Querystring { … } ,
_redirect : Redirect { … } ,
_rp_callbackOrig : undefined ,
_rp_options : Object { … } ,
_rp_promise : Promise { … } ,
_rp_reject : Function { } ,
_rp_resolve : Function { } ,
_started : true ,
_tunnel : Tunnel { … } ,
agent : Agent { … } ,
agentClass : Function Agent { … } ,
body : '{"name":"Miguel Espeso","username":"miguelito","password":"pl4tzi","email":"f@platzi.test"}' ,
callback : Function { } ,
dests : [ ] ,
explicitMethod : true ,
getHeader : Function { } ,
hasHeader : Function { } ,
headers : Object { … } ,
host : 'localhost' ,
href : 'http://localhost:43651/' ,
httpModule : Object { … } ,
localAddress : undefined ,
method : 'POST' ,
ntick : true ,
originalCookieHeader : undefined ,
originalHost : 'localhost:43651' ,
originalHostHeaderName : 'host' ,
path : '/' ,
pool : { } ,
port : '43651' ,
proxy : null ,
readable : true ,
removeHeader : Function { } ,
req : ClientRequest { … } ,
resolveWithFullResponse : true ,
response : [ Circular ] ,
responseContent : [ Circular ] ,
setHeader : Function { } ,
setHost : true ,
tunnel : false ,
uri : Url { … } ,
writable : true ,
} ,
socket : Socket {
_events : Object { … } ,
_eventsCount : 7 ,
_hadError : false ,
_handle : TCP { … } ,
_host : 'localhost' ,
_httpMessage : ClientRequest { … } ,
_maxListeners : undefined ,
_parent : null ,
_pendingData : null ,
_pendingEncoding : '' ,
_readableState : ReadableState [ … ] ,
_server : null ,
_sockname : null ,
_writableState : WritableState [ … ] ,
allowHalfOpen : false ,
connecting : false ,
parser : null ,
readable : true ,
server : null ,
writable : false ,
[ Symbol ( asyncId ) ] : 11 ,
[ Symbol ( lastWriteQueueSize ) ] : 0 ,
[ Symbol ( timeout ) ] : null ,
[ Symbol ( kBytesRead ) ] : 0 ,
[ Symbol ( kBytesWritten ) ] : 0 ,
} ,
statusCode : 404 ,
statusMessage : 'Not Found' ,
toJSON : Function responseToJSON { } ,
trailers : { } ,
upgrade : false ,
url : '' ,
} ,
statusCode : 404 ,
}
new StatusCodeError ( node_modules / request - promise - core / lib / errors . js : 32 : 15 )
Request . plumbing . callback ( node_modules / request - promise - core / lib / plumbing . js : 104 : 33 )
Request . RP $callback [ as _callback ] ( node_modules / request - promise - core / lib / plumbing . js : 46 : 31 )
Request . self . callback ( node_modules / request / request . js : 185 : 22 )
Request . < anonymous > ( node_modules / request / request . js : 1157 : 10 )
IncomingMessage . < anonymous > ( node_modules / request / request . js : 1079 : 12 )
pictures - test › GET / : id
/ home / miguel / cursos / cursoJs - Node / proyectoMichaelgram / michaelgram - api / test / pictures - test . js : 241
240 : let body = await request ( { uri : ` ${ url } / ${ image . publicId } ` , json : true } )
241 : t . deepEqual ( body , image )
242 : } )
Difference :
{
- createdAt : 'Thu Jul 19 2018 01:41:22 GMT+0200 (GMT+02:00)' ,
+ createdAt : 'Thu Jul 19 2018 01:41:21 GMT+0200 (GMT+02:00)' ,
description : '#awesome' ,
id : 'e6eb1240-89a3-11e8-a347-4b8e6af2d1b8' ,
liked : false ,
likes : 0 ,
publicId : '1qzJ82ib8L2KCYY6Pl2NzC' ,
src : 'http://michaelgram.test/1qzJ82ib8L2KCYY6Pl2NzC.jpg' ,
tags : Array [ … ] ,
userId : 'michaelgram' ,
}
pictures - test › POST / : id / like
/ home / miguel / cursos / cursoJs - Node / proyectoMichaelgram / michaelgram - api / test / pictures - test . js : 281
280 :
281 : t . deepEqual ( body , imageNew )
282 : } )
Difference :
{
- createdAt : 'Thu Jul 19 2018 01:41:22 GMT+0200 (GMT+02:00)' ,
+ createdAt : 'Thu Jul 19 2018 01:41:21 GMT+0200 (GMT+02:00)' ,
description : '#awesome' ,
id : 'e6eb1240-89a3-11e8-a347-4b8e6af2d1b8' ,
liked : true ,
likes : 1 ,
publicId : '1qzJ82ib8L2KCYY6Pl2NzC' ,
src : 'http://michaelgram.test/1qzJ82ib8L2KCYY6Pl2NzC.jpg' ,
tags : Array [ … ] ,
userId : 'michaelgram' ,
}
pictures - test › GET / tag / : tag
/ home / miguel / cursos / cursoJs - Node / proyectoMichaelgram / michaelgram - api / test / pictures - test . js : 311
310 :
311 : t . deepEqual ( body , images )
312 : } )
Difference :
[
{
- createdAt : 'Thu Jul 19 2018 01:41:22 GMT+0200 (GMT+02:00)' ,
+ createdAt : 'Thu Jul 19 2018 01:41:21 GMT+0200 (GMT+02:00)' ,
description : '#awesome' ,
id : 'e6eb1240-89a3-11e8-a347-4b8e6af2d1b8' ,
liked : false ,
likes : 0 ,
publicId : '1qzJ82ib8L2KCYY6Pl2NzC' ,
src : 'http://michaelgram.test/1qzJ82ib8L2KCYY6Pl2NzC.jpg' ,
tags : Array [ … ] ,
userId : 'michaelgram' ,
} ,
{
- createdAt : 'Thu Jul 19 2018 01:41:22 GMT+0200 (GMT+02:00)' ,
+ createdAt : 'Thu Jul 19 2018 01:41:21 GMT+0200 (GMT+02:00)' ,
description : '#awesome' ,
id : 'e6eb1240-89a3-11e8-a347-4b8e6af2d1b8' ,
liked : false ,
likes : 0 ,
publicId : '1qzJ82ib8L2KCYY6Pl2NzC' ,
src : 'http://michaelgram.test/1qzJ82ib8L2KCYY6Pl2NzC.jpg' ,
tags : Array [ … ] ,
userId : 'michaelgram' ,
} ,
]
pictures - test › POST /
/ home / miguel / cursos / cursoJs - Node / proyectoMichaelgram / michaelgram - api / test / pictures - test . js : 263
262 : t . is ( response . statusCode , 201 )
263 : t . deepEqual ( response . body , image )
264 : } )
Difference :
{
- createdAt : 'Thu Jul 19 2018 01:41:22 GMT+0200 (GMT+02:00)' ,
+ createdAt : 'Thu Jul 19 2018 01:41:21 GMT+0200 (GMT+02:00)' ,
description : '#awesome' ,
id : 'e6eb1240-89a3-11e8-a347-4b8e6af2d1b8' ,
liked : false ,
likes : 0 ,
publicId : '1qzJ82ib8L2KCYY6Pl2NzC' ,
src : 'http://michaelgram.test/1qzJ82ib8L2KCYY6Pl2NzC.jpg' ,
tags : Array [ … ] ,
userId : 'michaelgram' ,
}
pictures - test › GET / list
/ home / miguel / cursos / cursoJs - Node / proyectoMichaelgram / michaelgram - api / test / pictures - test . js : 296
295 :
296 : t . deepEqual ( body , images )
297 : } )
Difference :
[
{
- createdAt : 'Thu Jul 19 2018 01:41:22 GMT+0200 (GMT+02:00)' ,
+ createdAt : 'Thu Jul 19 2018 01:41:21 GMT+0200 (GMT+02:00)' ,
description : '#awesome' ,
id : 'e6eb1240-89a3-11e8-a347-4b8e6af2d1b8' ,
liked : false ,
likes : 0 ,
publicId : '1qzJ82ib8L2KCYY6Pl2NzC' ,
src : 'http://michaelgram.test/1qzJ82ib8L2KCYY6Pl2NzC.jpg' ,
tags : Array [ … ] ,
userId : 'michaelgram' ,
} ,
{
- createdAt : 'Thu Jul 19 2018 01:41:22 GMT+0200 (GMT+02:00)' ,
+ createdAt : 'Thu Jul 19 2018 01:41:21 GMT+0200 (GMT+02:00)' ,
description : '#awesome' ,
id : 'e6eb1240-89a3-11e8-a347-4b8e6af2d1b8' ,
liked : false ,
likes : 0 ,
publicId : '1qzJ82ib8L2KCYY6Pl2NzC' ,
src : 'http://michaelgram.test/1qzJ82ib8L2KCYY6Pl2NzC.jpg' ,
tags : Array [ … ] ,
userId : 'michaelgram' ,
} ,
{
- createdAt : 'Thu Jul 19 2018 01:41:22 GMT+0200 (GMT+02:00)' ,
+ createdAt : 'Thu Jul 19 2018 01:41:21 GMT+0200 (GMT+02:00)' ,
description : '#awesome' ,
id : 'e6eb1240-89a3-11e8-a347-4b8e6af2d1b8' ,
liked : false ,
likes : 0 ,
publicId : '1qzJ82ib8L2KCYY6Pl2NzC' ,
src : 'http://michaelgram.test/1qzJ82ib8L2KCYY6Pl2NzC.jpg' ,
tags : Array [ … ] ,
userId : 'michaelgram' ,
} ,
]
npm ERR ! Test failed . See above for more details .