Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- address Unit Testing - Constructor tests
- ✓ Create an address valid - All infomation valid
- ✓ Create an address invalid - invalid country
- ✓ Create an address invalid - invalid city
- ✓ Create an address invalid - invalid postal code
- ✓ Create an address infomation valid - empty
- ✓ Create an address null
- email Unit Testing - Constructor tests
- ✓ Create an email valid - All infomation valid - name@Test.com
- ✓ Create an email invalid - email with no @
- ✓ Create an email invalid - email with no .
- ✓ Create an email infomation valid - empty
- ✓ Create an email null
- Name Unit Testing - Constructor tests
- ✓ Create an name valid - All infomation valid - 2 names, with 1 space
- ✓ Create an name valid - All infomation valid - more than 2 names
- ✓ Create an name valid - invalid - name with 0 spaces
- ✓ Create an name valid - infomation valid - empty
- ✓ Create an name valid - null
- Nif Unit Testing - Constructor tests
- ✓ Create an nif valid - All infomation valid - nif with only numbers
- ✓ Create an nif valid - infomation valid - empty
- ✓ Create an nif valid - null
- Password Unit Testing - Constructor tests
- ✓ Create an password valid - All infomation valid - password with letters and numbers
- ✓ Create an password valid - All infomation valid - password with only numbers
- ✓ Create an password valid - infomation valid - empty
- ✓ Create an password valid - null
- Username Unit Testing - Constructor tests
- ✓ Create an username valid - All infomation valid - username with letters and numbers
- ✓ Create an username valid - All infomation valid - username with only numbers
- ✓ Create an username valid - infomation valid - empty
- ✓ Create an username valid - null
- client Unit Testing - Constructor tests
- ✓ Create an client valid - All infomation valid
- admin Unit Testing - Constructor tests
- ✓ Create an admin valid - All infomation valid
- Admin Service Unit Testing
- (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.
- (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.
- (node:1120) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
- ✓ Get Admins from DB
- ✓ Get Admin from DB - valid username
- ✓ Get Admins from DB - invalid username
- { _id: 5debd6db966cc3046054a475,
- name: 'client Test',
- email: 'email@test.com',
- nif: 123456789,
- password: '627682cfd166e5c632b2e9dc7979495a',
- address:
- { country: 'Portugal',
- city: 'Porto',
- street: 'Rua da boavista',
- number: '123',
- postalCode: '4440-352' },
- createdAt: 2019-12-07T16:44:12.118Z,
- updatedAt: 2019-12-07T16:44:12.118Z,
- __v: 0 }
- ✓ Verify Admin - valid admin
- ✓ Verify Admin - invalid admin
- ✓ Create Admin - valid admin
- ✓ Create Admin - invalid admin
- ✓ Create Admin - invalid admin - Already registed
- ✓ Delete Admin - invalid user - Root
- ✓ Delete Admin - valid username
- ✓ Delete Admin - invalid username
- client Service Unit Testing
- ✓ Get clients from DB - invalid getByEmail
- ✓ Get clients from DB - invalid getByNif
- ✓ Verify client - valid client
- ✓ Verify client - invalid client
- ✓ Create client - valid client
- ✓ Create client - invalid client
- order Service Unit Testing
- ✓ Get orders from DB
- 1) Create order - valid order
- ✓ Create order - valid order (51ms)
- ✓ Create order - invalid order - Already registed
- (node:1120) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'state' of undefined
- at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mocha/lib/runner.js:684:20
- at done (/opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mocha/lib/runnable.js:334:5)
- at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mocha/lib/runnable.js:392:11
- at <anonymous>
- at process._tickCallback (internal/process/next_tick.js:189:7)
- (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)
- (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.
- ✓ Delete order - valid id
- ✓ Delete order - invalid id
- 51 passing (551ms)
- 1 failing
- 1) order Service Unit Testing
- Create order - valid order:
- Uncaught AssertionError: expected false to equal true
- + expected - actual
- -false
- +true
- at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/test/services/orderServiceTest.js:123:33
- at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/services/orderService.js:60:13
- at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/repos/orderRepo.js:89:9
- at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mongoose/lib/model.js:4609:16
- at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/mongoose/lib/utils.js:268:11
- at $__save.error (node_modules/mongoose/lib/model.js:472:16)
- at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/kareem/index.js:246:48
- at next (node_modules/kareem/index.js:167:27)
- at next (node_modules/kareem/index.js:169:9)
- at Kareem.execPost (node_modules/kareem/index.js:217:3)
- at _handleWrapError (node_modules/kareem/index.js:245:21)
- at /opt/atlassian/pipelines/agent/build/GestaoEncomendas/node_modules/kareem/index.js:272:14
- at _next (node_modules/kareem/index.js:94:14)
- at process.nextTick (node_modules/kareem/index.js:507:38)
- at _combinedTickCallback (internal/process/next_tick.js:132:7)
- at process._tickCallback (internal/process/next_tick.js:181:9)
- npm ERR! code ELIFECYCLE
- npm ERR! errno 1
- npm ERR! gestaoencomendas@1.0.0 test: `mocha --timeout 120000 --require babel-register --recursive --exit`
- npm ERR! Exit status 1
- npm ERR!
- npm ERR! Failed at the gestaoencomendas@1.0.0 test script.
- npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
- npm ERR! A complete log of this run can be found in:
- npm ERR! /root/.npm/_logs/2019-12-07T16_44_12_685Z-debug.log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement