Advertisement
Guest User

Untitled

a guest
Dec 29th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.33 KB | None | 0 0
  1. 2) Create new profille. Should have 200 status. Should have correct content type and body in response
  2. ✓ Create new profile. Send wrong object. Should return 404 status code and string "no valid"
  3. ✓ Create profile with ID that already exists
  4. 2017-12-29T11:17:46.565+0000 [conn20] end connection 127.0.0.1:58576 (5 connections now open)
  5.  
  6. Test GET Profile endpoint (/profile/:id)
  7. 2017-12-29T11:17:46.567+0000 [initandlisten] connection accepted from 127.0.0.1:58584 #21 (6 connections now open)
  8. Get /profile/:id
  9. sseMiddleware is activated with [object Object] res: [object Object]
  10. sseMiddleware construct connection for response
  11. res has now connection res: [object Object]
  12. sseMiddleware is activated with [object Object] res: [object Object]
  13. sseMiddleware construct connection for response
  14. res has now connection res: [object Object]
  15. ✓ Request for get data without parametd ID
  16. ✓ Correctly get response
  17. ✓ Nonexistent id in get request
  18. { CastError: Cast to ObjectId failed for value "test_id" at path "_id"
  19. at CastError (/var/www/html_skn-local/node_modules/mongoose/lib/error/cast.js:27:11)
  20. at ObjectId.cast (/var/www/html_skn-local/node_modules/mongoose/lib/schema/objectid.js:158:13)
  21. at ObjectId.SchemaType._castForQuery (/var/www/html_skn-local/node_modules/mongoose/lib/schematype.js:1088:15)
  22. at ObjectId.castForQuery (/var/www/html_skn-local/node_modules/mongoose/lib/schema/objectid.js:198:15)
  23. at ObjectId.SchemaType.castForQueryWrapper (/var/www/html_skn-local/node_modules/mongoose/lib/schematype.js:1045:15)
  24. at cast (/var/www/html_skn-local/node_modules/mongoose/lib/cast.js:269:32)
  25. at model.Query.Query.cast (/var/www/html_skn-local/node_modules/mongoose/lib/query.js:3302:12)
  26. at model.Query.Query._castConditions (/var/www/html_skn-local/node_modules/mongoose/lib/query.js:1292:10)
  27. at model.Query.Query._findOne (/var/www/html_skn-local/node_modules/mongoose/lib/query.js:1504:8)
  28. at /var/www/html_skn-local/node_modules/kareem/index.js:250:8
  29. at /var/www/html_skn-local/node_modules/kareem/index.js:23:7
  30. at _combinedTickCallback (internal/process/next_tick.js:73:7)
  31. at process._tickDomainCallback (internal/process/next_tick.js:128:9)
  32. message: 'Cast to ObjectId failed for value "test_id" at path "_id" for model "Profile"',
  33. name: 'CastError',
  34. stringValue: '"test_id"',
  35. kind: 'ObjectId',
  36. value: 'test_id',
  37. path: '_id',
  38. reason: undefined,
  39. model:
  40. { [Function: model]
  41. hooks: Kareem { _pres: {}, _posts: {} },
  42. base:
  43. Mongoose {
  44. connections: [Object],
  45. models: [Object],
  46. modelSchemas: [Object],
  47. options: [Object],
  48. plugins: [Object] },
  49. modelName: 'Profile',
  50. model: [Function: model],
  51. db:
  52. NativeConnection {
  53. base: [Object],
  54. collections: [Object],
  55. models: [Object],
  56. config: [Object],
  57. replica: false,
  58. hosts: null,
  59. host: 'localhost',
  60. port: 27017,
  61. user: undefined,
  62. pass: undefined,
  63. name: 'testing',
  64. options: [Object],
  65. otherDbs: [],
  66. states: [Object],
  67. _readyState: 1,
  68. _closeCalled: false,
  69. _hasOpened: true,
  70. _listening: false,
  71. db: [Object],
  72. '$wasForceClosed': false },
  73. discriminators: undefined,
  74. '$appliedMethods': true,
  75. '$appliedHooks': true,
  76. _events: { init: [Function], save: [Function] },
  77. _eventsCount: 2,
  78. schema:
  79. Schema {
  80. obj: [Object],
  81. paths: [Object],
  82. aliases: {},
  83. subpaths: {},
  84. virtuals: [Object],
  85. singleNestedPaths: {},
  86. nested: {},
  87. inherits: {},
  88. callQueue: [Object],
  89. _indexes: [],
  90. methods: {},
  91. statics: {},
  92. tree: [Object],
  93. query: {},
  94. childSchemas: [],
  95. plugins: [Object],
  96. s: [Object],
  97. _userProvidedOptions: undefined,
  98. options: [Object],
  99. '$globalPluginsApplied': true,
  100. _requiredpaths: [Object] },
  101. collection:
  102. NativeCollection {
  103. collection: [Object],
  104. opts: [Object],
  105. name: 'profiles',
  106. collectionName: 'profiles',
  107. conn: [Object],
  108. queue: [],
  109. buffer: false,
  110. emitter: [Object] },
  111. Query: { [Function] base: [Object] },
  112. '$__insertMany': [Function],
  113. insertMany: [Function],
  114. '$init': Promise { emitter: [Object], emitted: [Object], ended: false } } }
  115. ✓ Bad id in get request
  116. 2017-12-29T11:17:46.689+0000 [conn21] end connection 127.0.0.1:58584 (5 connections now open)
  117.  
  118. Test update profile endpoint (/profile/:id) PUT
  119. 2017-12-29T11:17:46.695+0000 [initandlisten] connection accepted from 127.0.0.1:58594 #22 (6 connections now open)
  120. Test update profile
  121. ✓ Update profile with correct data and id. Should return updated profile
  122. sseMiddleware is activated with [object Object] res: [object Object]
  123. sseMiddleware construct connection for response
  124. res has now connection res: [object Object]
  125. sseMiddleware is activated with [object Object] res: [object Object]
  126. sseMiddleware construct connection for response
  127. res has now connection res: [object Object]
  128. ✓ Request without profile id
  129. ✓ Update profile with no existing ID
  130. ✓ Update profile with wrong ID
  131. ✓ Update profile with no valid data
  132. 2017-12-29T11:17:46.779+0000 [conn22] end connection 127.0.0.1:58594 (5 connections now open)
  133.  
  134.  
  135. 54 passing (2s)
  136. 2 failing
  137.  
  138. 1) Uncaught error outside test suite:
  139. Uncaught Error: listen EADDRINUSE :::8080
  140. at Object.exports._errnoException (util.js:1050:11)
  141. at exports._exceptionWithHostPort (util.js:1073:20)
  142. at Server.setupListenHandle [as _listen2] (net.js:1259:14)
  143. at listenInCluster (net.js:1307:12)
  144. at Server.listen (net.js:1406:7)
  145. at Function.listen (node_modules/express/lib/application.js:618:24)
  146. at Object.<anonymous> (server/app.js:6:28)
  147. at Module.replacementCompile (node_modules/nyc/node_modules/append-transform/index.js:58:13)
  148. at loader (node_modules/babel-register/lib/node.js:144:5)
  149. at require.extensions.(anonymous function) (node_modules/babel-register/lib/node.js:154:7)
  150. at Object.<anonymous> (node_modules/nyc/node_modules/append-transform/index.js:62:4)
  151. at require (internal/module.js:20:19)
  152. at Object.<anonymous> (server/test/settings_access_group/settings_access_group_create.js:1:9383)
  153. at Module.replacementCompile (node_modules/nyc/node_modules/append-transform/index.js:58:13)
  154. at loader (node_modules/babel-register/lib/node.js:144:5)
  155. at require.extensions.(anonymous function) (node_modules/babel-register/lib/node.js:154:7)
  156. at Object.<anonymous> (node_modules/nyc/node_modules/append-transform/index.js:62:4)
  157. at require (internal/module.js:20:19)
  158. at Array.forEach (native)
  159. at Module.replacementCompile (node_modules/nyc/node_modules/append-transform/index.js:58:13)
  160. at module.exports (node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
  161. at Object.<anonymous> (node_modules/nyc/node_modules/append-transform/index.js:62:4)
  162. at runMain (/root/.node-spawn-wrap-300-87bde47f2832/nodejs:68:10)
  163. at Function.<anonymous> (/root/.node-spawn-wrap-300-87bde47f2832/nodejs:171:5)
  164. at Object.<anonymous> (node_modules/nyc/bin/wrap.js:23:4)
  165. at /root/.node-spawn-wrap-300-87bde47f2832/nodejs:178:8
  166. at Object.<anonymous> (/root/.node-spawn-wrap-300-87bde47f2832/nodejs:181:3)
  167. at run (bootstrap_node.js:427:7)
  168. at startup (bootstrap_node.js:151:9)
  169. at bootstrap_node.js:542:3
  170.  
  171. 2) Test CREATE Profile endpoint (/profile)
  172. Create new profille. Should have 200 status. Should have correct content type and body in response:
  173. Uncaught AssertionError: expected [Error: expected 200 "OK", got 500 "Internal Server Error"] to equal null
  174. at Test.<anonymous> (server/test/user_profile/user_profile_create.js:1:12285)
  175. at Test.assert (node_modules/supertest/lib/test.js:179:6)
  176. at Server.assert (node_modules/supertest/lib/test.js:131:12)
  177. at emitCloseNT (net.js:1577:8)
  178. at _combinedTickCallback (internal/process/next_tick.js:77:11)
  179. at process._tickDomainCallback (internal/process/next_tick.js:128:9)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement