Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.77 KB | None | 0 0
  1.  
  2. address Unit Testing - Constructor tests
  3. ✓ Create an address valid - All infomation valid
  4. ✓ Create an address invalid - invalid country
  5. ✓ Create an address invalid - invalid city
  6. ✓ Create an address invalid - invalid postal code
  7. ✓ Create an address infomation valid - empty
  8. ✓ Create an address null
  9. email Unit Testing - Constructor tests
  10. ✓ Create an email valid - All infomation valid - name@Test.com
  11. ✓ Create an email invalid - email with no @
  12. ✓ Create an email invalid - email with no .
  13. ✓ Create an email infomation valid - empty
  14. ✓ Create an email null
  15. Name Unit Testing - Constructor tests
  16. ✓ Create an name valid - All infomation valid - 2 names, with 1 space
  17. ✓ Create an name valid - All infomation valid - more than 2 names
  18. ✓ Create an name valid - invalid - name with 0 spaces
  19. ✓ Create an name valid - infomation valid - empty
  20. ✓ Create an name valid - null
  21. Nif Unit Testing - Constructor tests
  22. ✓ Create an nif valid - All infomation valid - nif with only numbers
  23. ✓ Create an nif valid - infomation valid - empty
  24. ✓ Create an nif valid - null
  25. Password Unit Testing - Constructor tests
  26. ✓ Create an password valid - All infomation valid - password with letters and numbers
  27. ✓ Create an password valid - All infomation valid - password with only numbers
  28. ✓ Create an password valid - infomation valid - empty
  29. ✓ Create an password valid - null
  30. Username Unit Testing - Constructor tests
  31. ✓ Create an username valid - All infomation valid - username with letters and numbers
  32. ✓ Create an username valid - All infomation valid - username with only numbers
  33. ✓ Create an username valid - infomation valid - empty
  34. ✓ Create an username valid - null
  35. client Unit Testing - Constructor tests
  36. ✓ Create an client valid - All infomation valid
  37. admin Unit Testing - Constructor tests
  38. ✓ Create an admin valid - All infomation valid
  39. Admin Service Unit Testing
  40. (node:1120) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
  41. (node:1120) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
  42. (node:1120) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
  43. ✓ Get Admins from DB
  44. ✓ Get Admin from DB - valid username
  45. ✓ Get Admins from DB - invalid username
  46. { _id: 5debd6db966cc3046054a475,
  47. name: 'client Test',
  48. email: 'email@test.com',
  49. nif: 123456789,
  50. password: '627682cfd166e5c632b2e9dc7979495a',
  51. address:
  52. { country: 'Portugal',
  53. city: 'Porto',
  54. street: 'Rua da boavista',
  55. number: '123',
  56. postalCode: '4440-352' },
  57. createdAt: 2019-12-07T16:44:12.118Z,
  58. updatedAt: 2019-12-07T16:44:12.118Z,
  59. __v: 0 }
  60. ✓ Verify Admin - valid admin
  61. ✓ Verify Admin - invalid admin
  62. ✓ Create Admin - valid admin
  63. ✓ Create Admin - invalid admin
  64. ✓ Create Admin - invalid admin - Already registed
  65. ✓ Delete Admin - invalid user - Root
  66. ✓ Delete Admin - valid username
  67. ✓ Delete Admin - invalid username
  68. client Service Unit Testing
  69. ✓ Get clients from DB - invalid getByEmail
  70. ✓ Get clients from DB - invalid getByNif
  71. ✓ Verify client - valid client
  72. ✓ Verify client - invalid client
  73. ✓ Create client - valid client
  74. ✓ Create client - invalid client
  75. order Service Unit Testing
  76. ✓ Get orders from DB
  77. 1) Create order - valid order
  78. ✓ Create order - valid order (51ms)
  79. ✓ Create order - invalid order - Already registed
  80. (node:1120) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'state' of undefined
  81. at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mocha/lib/runner.js:684:20
  82. at done (/opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mocha/lib/runnable.js:334:5)
  83. at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mocha/lib/runnable.js:392:11
  84. at <anonymous>
  85. at process._tickCallback (internal/process/next_tick.js:189:7)
  86. (node:1120) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
  87. (node:1120) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  88. ✓ Delete order - valid id
  89. ✓ Delete order - invalid id
  90. 51 passing (551ms)
  91. 1 failing
  92. 1) order Service Unit Testing
  93. Create order - valid order:
  94. Uncaught AssertionError: expected false to equal true
  95. + expected - actual
  96. -false
  97. +true
  98.  
  99. at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/test/services/orderServiceTest.js:123:33
  100. at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/services/orderService.js:60:13
  101. at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/repos/orderRepo.js:89:9
  102. at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mongoose/lib/model.js:4609:16
  103. at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mongoose/lib/utils.js:268:11
  104. at $__save.error (node_modules/mongoose/lib/model.js:472:16)
  105. at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/kareem/index.js:246:48
  106. at next (node_modules/kareem/index.js:167:27)
  107. at next (node_modules/kareem/index.js:169:9)
  108. at Kareem.execPost (node_modules/kareem/index.js:217:3)
  109. at _handleWrapError (node_modules/kareem/index.js:245:21)
  110. at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/kareem/index.js:272:14
  111. at _next (node_modules/kareem/index.js:94:14)
  112. at process.nextTick (node_modules/kareem/index.js:507:38)
  113. at _combinedTickCallback (internal/process/next_tick.js:132:7)
  114. at process._tickCallback (internal/process/next_tick.js:181:9)
  115. npm ERR! code ELIFECYCLE
  116. npm ERR! errno 1
  117. npm ERR! gestaoencomendas@1.0.0 test: `mocha --timeout 120000 --require babel-register --recursive --exit`
  118. npm ERR! Exit status 1
  119. npm ERR!
  120. npm ERR! Failed at the gestaoencomendas@1.0.0 test script.
  121. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  122. npm ERR! A complete log of this run can be found in:
  123. npm ERR! /root/.npm/_logs/2019-12-07T16_44_12_685Z-debug.log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement