Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2) Create new profille. Should have 200 status. Should have correct content type and body in response
- ✓ Create new profile. Send wrong object. Should return 404 status code and string "no valid"
- ✓ Create profile with ID that already exists
- 2017-12-29T11:17:46.565+0000 [conn20] end connection 127.0.0.1:58576 (5 connections now open)
- Test GET Profile endpoint (/profile/:id)
- 2017-12-29T11:17:46.567+0000 [initandlisten] connection accepted from 127.0.0.1:58584 #21 (6 connections now open)
- Get /profile/:id
- sseMiddleware is activated with [object Object] res: [object Object]
- sseMiddleware construct connection for response
- res has now connection res: [object Object]
- sseMiddleware is activated with [object Object] res: [object Object]
- sseMiddleware construct connection for response
- res has now connection res: [object Object]
- ✓ Request for get data without parametd ID
- ✓ Correctly get response
- ✓ Nonexistent id in get request
- { CastError: Cast to ObjectId failed for value "test_id" at path "_id"
- at CastError (/var/www/html_skn-local/node_modules/mongoose/lib/error/cast.js:27:11)
- at ObjectId.cast (/var/www/html_skn-local/node_modules/mongoose/lib/schema/objectid.js:158:13)
- at ObjectId.SchemaType._castForQuery (/var/www/html_skn-local/node_modules/mongoose/lib/schematype.js:1088:15)
- at ObjectId.castForQuery (/var/www/html_skn-local/node_modules/mongoose/lib/schema/objectid.js:198:15)
- at ObjectId.SchemaType.castForQueryWrapper (/var/www/html_skn-local/node_modules/mongoose/lib/schematype.js:1045:15)
- at cast (/var/www/html_skn-local/node_modules/mongoose/lib/cast.js:269:32)
- at model.Query.Query.cast (/var/www/html_skn-local/node_modules/mongoose/lib/query.js:3302:12)
- at model.Query.Query._castConditions (/var/www/html_skn-local/node_modules/mongoose/lib/query.js:1292:10)
- at model.Query.Query._findOne (/var/www/html_skn-local/node_modules/mongoose/lib/query.js:1504:8)
- at /var/www/html_skn-local/node_modules/kareem/index.js:250:8
- at /var/www/html_skn-local/node_modules/kareem/index.js:23:7
- at _combinedTickCallback (internal/process/next_tick.js:73:7)
- at process._tickDomainCallback (internal/process/next_tick.js:128:9)
- message: 'Cast to ObjectId failed for value "test_id" at path "_id" for model "Profile"',
- name: 'CastError',
- stringValue: '"test_id"',
- kind: 'ObjectId',
- value: 'test_id',
- path: '_id',
- reason: undefined,
- model:
- { [Function: model]
- hooks: Kareem { _pres: {}, _posts: {} },
- base:
- Mongoose {
- connections: [Object],
- models: [Object],
- modelSchemas: [Object],
- options: [Object],
- plugins: [Object] },
- modelName: 'Profile',
- model: [Function: model],
- db:
- NativeConnection {
- base: [Object],
- collections: [Object],
- models: [Object],
- config: [Object],
- replica: false,
- hosts: null,
- host: 'localhost',
- port: 27017,
- user: undefined,
- pass: undefined,
- name: 'testing',
- options: [Object],
- otherDbs: [],
- states: [Object],
- _readyState: 1,
- _closeCalled: false,
- _hasOpened: true,
- _listening: false,
- db: [Object],
- '$wasForceClosed': false },
- discriminators: undefined,
- '$appliedMethods': true,
- '$appliedHooks': true,
- _events: { init: [Function], save: [Function] },
- _eventsCount: 2,
- schema:
- Schema {
- obj: [Object],
- paths: [Object],
- aliases: {},
- subpaths: {},
- virtuals: [Object],
- singleNestedPaths: {},
- nested: {},
- inherits: {},
- callQueue: [Object],
- _indexes: [],
- methods: {},
- statics: {},
- tree: [Object],
- query: {},
- childSchemas: [],
- plugins: [Object],
- s: [Object],
- _userProvidedOptions: undefined,
- options: [Object],
- '$globalPluginsApplied': true,
- _requiredpaths: [Object] },
- collection:
- NativeCollection {
- collection: [Object],
- opts: [Object],
- name: 'profiles',
- collectionName: 'profiles',
- conn: [Object],
- queue: [],
- buffer: false,
- emitter: [Object] },
- Query: { [Function] base: [Object] },
- '$__insertMany': [Function],
- insertMany: [Function],
- '$init': Promise { emitter: [Object], emitted: [Object], ended: false } } }
- ✓ Bad id in get request
- 2017-12-29T11:17:46.689+0000 [conn21] end connection 127.0.0.1:58584 (5 connections now open)
- Test update profile endpoint (/profile/:id) PUT
- 2017-12-29T11:17:46.695+0000 [initandlisten] connection accepted from 127.0.0.1:58594 #22 (6 connections now open)
- Test update profile
- ✓ Update profile with correct data and id. Should return updated profile
- sseMiddleware is activated with [object Object] res: [object Object]
- sseMiddleware construct connection for response
- res has now connection res: [object Object]
- sseMiddleware is activated with [object Object] res: [object Object]
- sseMiddleware construct connection for response
- res has now connection res: [object Object]
- ✓ Request without profile id
- ✓ Update profile with no existing ID
- ✓ Update profile with wrong ID
- ✓ Update profile with no valid data
- 2017-12-29T11:17:46.779+0000 [conn22] end connection 127.0.0.1:58594 (5 connections now open)
- 54 passing (2s)
- 2 failing
- 1) Uncaught error outside test suite:
- Uncaught Error: listen EADDRINUSE :::8080
- at Object.exports._errnoException (util.js:1050:11)
- at exports._exceptionWithHostPort (util.js:1073:20)
- at Server.setupListenHandle [as _listen2] (net.js:1259:14)
- at listenInCluster (net.js:1307:12)
- at Server.listen (net.js:1406:7)
- at Function.listen (node_modules/express/lib/application.js:618:24)
- at Object.<anonymous> (server/app.js:6:28)
- at Module.replacementCompile (node_modules/nyc/node_modules/append-transform/index.js:58:13)
- at loader (node_modules/babel-register/lib/node.js:144:5)
- at require.extensions.(anonymous function) (node_modules/babel-register/lib/node.js:154:7)
- at Object.<anonymous> (node_modules/nyc/node_modules/append-transform/index.js:62:4)
- at require (internal/module.js:20:19)
- at Object.<anonymous> (server/test/settings_access_group/settings_access_group_create.js:1:9383)
- at Module.replacementCompile (node_modules/nyc/node_modules/append-transform/index.js:58:13)
- at loader (node_modules/babel-register/lib/node.js:144:5)
- at require.extensions.(anonymous function) (node_modules/babel-register/lib/node.js:154:7)
- at Object.<anonymous> (node_modules/nyc/node_modules/append-transform/index.js:62:4)
- at require (internal/module.js:20:19)
- at Array.forEach (native)
- at Module.replacementCompile (node_modules/nyc/node_modules/append-transform/index.js:58:13)
- at module.exports (node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
- at Object.<anonymous> (node_modules/nyc/node_modules/append-transform/index.js:62:4)
- at runMain (/root/.node-spawn-wrap-300-87bde47f2832/nodejs:68:10)
- at Function.<anonymous> (/root/.node-spawn-wrap-300-87bde47f2832/nodejs:171:5)
- at Object.<anonymous> (node_modules/nyc/bin/wrap.js:23:4)
- at /root/.node-spawn-wrap-300-87bde47f2832/nodejs:178:8
- at Object.<anonymous> (/root/.node-spawn-wrap-300-87bde47f2832/nodejs:181:3)
- at run (bootstrap_node.js:427:7)
- at startup (bootstrap_node.js:151:9)
- at bootstrap_node.js:542:3
- 2) Test CREATE Profile endpoint (/profile)
- Create new profille. Should have 200 status. Should have correct content type and body in response:
- Uncaught AssertionError: expected [Error: expected 200 "OK", got 500 "Internal Server Error"] to equal null
- at Test.<anonymous> (server/test/user_profile/user_profile_create.js:1:12285)
- at Test.assert (node_modules/supertest/lib/test.js:179:6)
- at Server.assert (node_modules/supertest/lib/test.js:131:12)
- at emitCloseNT (net.js:1577:8)
- at _combinedTickCallback (internal/process/next_tick.js:77:11)
- at process._tickDomainCallback (internal/process/next_tick.js:128:9)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement