at Context. (test/users-endpoints.spec.js:237:22)
at process.processImmediate (node:internal/timers:478:21)
at error (node_modules/supertest/lib/test.js:335:15)
at Test._assertBody (node_modules/supertest/lib/test.js:193:16)
at /Users/Georgia/software_engineering_projects/veronaut-products-api/node_modules/supertest/lib/test.js:308:13
at Test._assertFunction (node_modules/supertest/lib/test.js:285:13)
at Test.assert (node_modules/supertest/lib/test.js:164:23)
at Server.localAssert (node_modules/supertest/lib/test.js:120:14)
at Object.onceWrapper (node:events:633:28)
at Server.emit (node:events:519:28)
at emitCloseNT (node:net:2279:8)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
[ ] 2) Users Endpoints
GET /api/users/:user_id/products
"before each" hook for "returns all the user's products":
ReferenceError: factoryInsert is not defined
at Context. (test/users-endpoints.spec.js:267:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[ ] 3) Users Endpoints
POST /api/users/:user_id/products
"before each" hook for "creates a user-product set, responding with 201 and the new set":
ReferenceError: factoryInsert is not defined
at Context. (test/users-endpoints.spec.js:434:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[ ] 4) Users Endpoints
PATCH /api/users/:user_id
"before each" hook for "responds with 204 and updates the user":
ReferenceError: factoryInsert is not defined
at Context. (test/users-endpoints.spec.js:489:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[ ] 5) Users Endpoints
DELETE /api/users/:user_id/products
"before each" hook for "responds with 204 and removes the user-product relationship":
ReferenceError: factoryInsert is not defined
at Context. (test/users-endpoints.spec.js:629:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[ ] 1) Users Endpoints GET /api/users Given there are users in the database GET /api/users responds with 200 and all of the users:
Error: expected [ { id: 1, email: 'georgia.kirkpatrick@gmail.com', password: '$2a$10$mBCrwFfPYRgE/rU6RhCYoO5AfizIlWeZfg.zoDGUNiSkhlzOwAtVu', handle: 'Georgiakirkpatrick', first_name: 'Georgia', last_name: 'Kirkpatrick', website: 'georgiakirkpatrick.com', profile_pic: 'https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg', bio: 'Georgia is a computer programmer from Portland, Oregon.', public: false, admin: false, editor: false, can_submit: true, org_affiliation: 'None', created_at: '2023-02-27 14:24:38.513 -0800', updated_at: '2023-02-27 14:24:38.513 -0800' }, { id: 2, admin: false, email: 'jonathan.pak@gmail.com', password: '$2a$10$IDZV2CKqQxPp9jI3UNW1quyBXzsST.ibd6Xm4BCGljMgTasku3K7i', handle: 'jonnypak', first_name: 'Jon', last_name: 'Pak', website: 'jonathanpak.com', profile_pic: 'https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg', bio: 'Jonathan is a computer programmer from Portland, Oregon.', public: false, editor: false, can_submit: true, org_affiliation: 'None', created_at: '2023-02-27 14:24:38.513 -0800', updated_at: '2023-02-27 14:24:38.513 -0800' }, { id: 3, email: 'admin-georgia@veronaut.com', password: '$2a$04$FNv6KvjY.vBFHdyvdMsLbez7N4Sh.8QTfsmjshGViO09wG6P1HYzG', handle: 'veronaut-georgia', first_name: 'Veronaut', last_name: 'Veronaut', website: 'veronaut.com', profile_pic: 'https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg', bio: 'Georgia is a computer programmer from Portland, Oregon.', public: false, admin: true, editor: true, can_submit: true, org_affiliation: null, created_at: '2023-02-27 14:24:38.513 -0800', updated_at: '2023-02-27 14:24:38.513 -0800' }, { id: 4, email: 'admin-charlotte@veronaut.com', password: '$2a$04$BMhz3EL9gTijgwlm...fTu1IBwpKChJ533g9L0mMUBot766RUfobu', handle: 'veronaut-charlotte', first_name: 'Veronaut', last_name: 'Veronaut', website: 'veronaut.com', profile_pic: 'https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg', bio: 'Charlotte is a computer programmer from Portland, Oregon.', public: false, admin: true, editor: true, can_submit: true, org_affiliation: null, created_at: '2023-02-27 14:24:38.513 -0800', updated_at: '2023-02-27 14:24:38.513 -0800' } ] response body, got [ { id: 1, email: 'georgia.kirkpatrick@gmail.com', password: '$2a$10$mBCrwFfPYRgE/rU6RhCYoO5AfizIlWeZfg.zoDGUNiSkhlzOwAtVu', handle: 'Georgiakirkpatrick', first_name: 'Georgia', last_name: 'Kirkpatrick', website: 'georgiakirkpatrick.com', profile_pic: 'https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg', bio: 'Georgia is a computer programmer from Portland, Oregon.', admin: false, public: false, editor: false, can_submit: true, org_affiliation: 'None', created_at: '2023-02-27T22:24:38.513Z', updated_at: '2023-02-27T22:24:38.513Z' }, { id: 2, email: 'jonathan.pak@gmail.com', password: '$2a$10$IDZV2CKqQxPp9jI3UNW1quyBXzsST.ibd6Xm4BCGljMgTasku3K7i', handle: 'jonnypak', first_name: 'Jon', last_name: 'Pak', website: 'jonathanpak.com', profile_pic: 'https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg', bio: 'Jonathan is a computer programmer from Portland, Oregon.', admin: false, public: false, editor: false, can_submit: true, org_affiliation: 'None', created_at: '2023-02-27T22:24:38.513Z', updated_at: '2023-02-27T22:24:38.513Z' }, { id: 3, email: 'admin-georgia@veronaut.com', password: '$2a$04$FNv6KvjY.vBFHdyvdMsLbez7N4Sh.8QTfsmjshGViO09wG6P1HYzG', handle: 'veronaut-georgia', first_name: 'Veronaut', last_name: 'Veronaut', website: 'veronaut.com', profile_pic: 'https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg', bio: 'Georgia is a computer programmer from Portland, Oregon.', admin: true, public: false, editor: true, can_submit: true, org_affiliation: null, created_at: '2023-02-27T22:24:38.513Z', updated_at: '2023-02-27T22:24:38.513Z' }, { id: 4, email: 'admin-charlotte@veronaut.com', password: '$2a$04$BMhz3EL9gTijgwlm...fTu1IBwpKChJ533g9L0mMUBot766RUfobu', handle: 'veronaut-charlotte', first_name: 'Veronaut', last_name: 'Veronaut', website: 'veronaut.com', profile_pic: 'https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg', bio: 'Charlotte is a computer programmer from Portland, Oregon.', admin: true, public: false, editor: true, can_submit: true, org_affiliation: null, created_at: '2023-02-27T22:24:38.513Z', updated_at: '2023-02-27T22:24:38.513Z' } ]
expected - actual
{ "admin": false "bio": "Georgia is a computer programmer from Portland, Oregon." "can_submit": true
"created_at": "2023-02-27 14:24:38.513 -0800" "editor": false "email": "georgia.kirkpatrick@gmail.com" "first_name": "Georgia" "handle": "Georgiakirkpatrick"
"org_affiliation": "None" "password": "$2a$10$mBCrwFfPYRgE/rU6RhCYoO5AfizIlWeZfg.zoDGUNiSkhlzOwAtVu" "profile_pic": "https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg" "public": false
"created_at": "2023-02-27 14:24:38.513 -0800" "editor": false "email": "jonathan.pak@gmail.com" "first_name": "Jon" "handle": "jonnypak"
"org_affiliation": "None" "password": "$2a$10$IDZV2CKqQxPp9jI3UNW1quyBXzsST.ibd6Xm4BCGljMgTasku3K7i" "profile_pic": "https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg" "public": false
"created_at": "2023-02-27 14:24:38.513 -0800" "editor": true "email": "admin-georgia@veronaut.com" "first_name": "Veronaut" "handle": "veronaut-georgia"
"org_affiliation": [null] "password": "$2a$04$FNv6KvjY.vBFHdyvdMsLbez7N4Sh.8QTfsmjshGViO09wG6P1HYzG" "profile_pic": "https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg" "public": false
"created_at": "2023-02-27 14:24:38.513 -0800" "editor": true "email": "admin-charlotte@veronaut.com" "first_name": "Veronaut" "handle": "veronaut-charlotte"
"org_affiliation": [null] "password": "$2a$04$BMhz3EL9gTijgwlm...fTu1IBwpKChJ533g9L0mMUBot766RUfobu" "profile_pic": "https://www.talk-business.co.uk/wp-content/uploads/2016/05/shutterstock_128709044.jpg" "public": false
"updated_at": "2023-02-27 14:24:38.513 -0800" "website": "veronaut.com" } ]
at Context. (test/users-endpoints.spec.js:237:22)
at process.processImmediate (node:internal/timers:478:21)
at error (node_modules/supertest/lib/test.js:335:15) at Test._assertBody (node_modules/supertest/lib/test.js:193:16) at /Users/Georgia/software_engineering_projects/veronaut-products-api/node_modules/supertest/lib/test.js:308:13 at Test._assertFunction (node_modules/supertest/lib/test.js:285:13) at Test.assert (node_modules/supertest/lib/test.js:164:23) at Server.localAssert (node_modules/supertest/lib/test.js:120:14) at Object.onceWrapper (node:events:633:28) at Server.emit (node:events:519:28) at emitCloseNT (node:net:2279:8) at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
[ ] 2) Users Endpoints GET /api/users/:user_id/products "before each" hook for "returns all the user's products": ReferenceError: factoryInsert is not defined at Context. (test/users-endpoints.spec.js:267:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[ ] 3) Users Endpoints POST /api/users/:user_id/products "before each" hook for "creates a user-product set, responding with 201 and the new set": ReferenceError: factoryInsert is not defined at Context. (test/users-endpoints.spec.js:434:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[ ] 4) Users Endpoints PATCH /api/users/:user_id "before each" hook for "responds with 204 and updates the user": ReferenceError: factoryInsert is not defined at Context. (test/users-endpoints.spec.js:489:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[ ] 5) Users Endpoints DELETE /api/users/:user_id/products "before each" hook for "responds with 204 and removes the user-product relationship": ReferenceError: factoryInsert is not defined at Context. (test/users-endpoints.spec.js:629:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)