backend rewrite #1580
Annotations
10 errors and 1 warning
test
@zotmeal/api#test: command (/home/runner/work/ZotMeal/ZotMeal/packages/api) /home/runner/setup-pnpm/node_modules/.bin/pnpm run test exited (1)
|
src/dishes/router.test.ts > getRatingProcedure > returns a rating:
packages/api/src/dishes/router.ts#L21
TRPCError: column "num_ratings" does not exist
❯ ../../node_modules/pg-pool/index.js:45:11
❯ ../../node_modules/src/node-postgres/session.ts:66:19
❯ src/dishes/router.ts:21:18
❯ resolveMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
❯ src/dishes/router.test.ts:10:20
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'INTERNAL_SERVER_ERROR' }
Caused by: error: column "num_ratings" does not exist
❯ ../../node_modules/pg-pool/index.js:45:11
❯ ../../node_modules/src/node-postgres/session.ts:66:19
❯ src/dishes/router.ts:21:18
❯ resolveMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
❯ src/dishes/router.test.ts:10:20
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { length: 111, severity: 'ERROR', code: '42703', detail: undefined, hint: undefined, position: '49', internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'parse_relation.c', line: '3718', routine: 'errorMissingColumn' }
|
src/dishes/router.test.ts > rateDishProcedure > returns a rating:
packages/api/src/dishes/router.ts#L37
TRPCError: column "num_ratings" does not exist
❯ ../../node_modules/pg-pool/index.js:45:11
❯ ../../node_modules/src/node-postgres/session.ts:66:19
❯ src/dishes/router.ts:37:18
❯ resolveMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
❯ src/dishes/router.test.ts:32:20
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'INTERNAL_SERVER_ERROR' }
Caused by: error: column "num_ratings" does not exist
❯ ../../node_modules/pg-pool/index.js:45:11
❯ ../../node_modules/src/node-postgres/session.ts:66:19
❯ src/dishes/router.ts:37:18
❯ resolveMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
❯ src/dishes/router.test.ts:32:20
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { length: 111, severity: 'ERROR', code: '42703', detail: undefined, hint: undefined, position: '49', internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'parse_relation.c', line: '3718', routine: 'errorMissingColumn' }
|
src/menus/router.test.ts > GetMenuSchema validates properly > parses valid params:
packages/api/src/menus/router.test.ts#L25
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ src/menus/router.test.ts:25:30
|
src/menus/router.test.ts > menu.get > should get today's brandywine lunch menu:
packages/api/src/menus/router.test.ts#L51
TRPCError: [
{
"code": "invalid_type",
"expected": "date",
"received": "string",
"path": [
"date"
],
"message": "Expected date, received string"
}
]
❯ inputValidatorMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/middleware.mjs:46:19
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
❯ src/menus/router.test.ts:51:18
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'BAD_REQUEST' }
Caused by: ZodError: [
{
"code": "invalid_type",
"expected": "date",
"received": "string",
"path": [
"date"
],
"message": "Expected date, received string"
}
]
❯ Object.get error [as error] ../../node_modules/zod/lib/index.mjs:587:31
❯ ZodObject.parseAsync ../../node_modules/zod/lib/index.mjs:715:22
❯ inputValidatorMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/middleware.mjs:44:27
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
❯ src/menus/router.test.ts:51:18
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { issues: [ { code: 'invalid_type', expected: 'date', received: 'string', path: [ 'date' ], message: 'Expected date, received string' } ], addIssue: 'Function<anonymous>', addIssues: 'Function<anonymous>', errors: [ { code: 'invalid_type', expected: 'date', received: 'string', path: [ 'date' ], message: 'Expected date, received string' } ], format: 'Function<format>', isEmpty: false, flatten: 'Function<flatten>', formErrors: { formErrors: [], fieldErrors: { date: [ 'Expected date, received string' ] } } }
|
src/ratings/services.test.ts > getNumRatingsByDishId > returns the number of ratings for a dish:
packages/api/src/ratings/services.test.ts#L117
AssertionError: expected [Function] to throw error including 'Rollback' but got 'insert or update on table "ratings" v…'
- Expected
+ Received
- Rollback
+ insert or update on table "ratings" violates foreign key constraint "ratings_user_id_users_id_fk"
❯ src/ratings/services.test.ts:117:5
|
src/ratings/services.test.ts > getTotalRatingByDishId > returns the total rating for a dish:
packages/api/src/ratings/services.test.ts#L145
AssertionError: expected [Function] to throw error including 'Rollback' but got 'insert or update on table "ratings" v…'
- Expected
+ Received
- Rollback
+ insert or update on table "ratings" violates foreign key constraint "ratings_user_id_users_id_fk"
❯ src/ratings/services.test.ts:145:5
|
src/users/router.test.ts > getUserProcedure > gets a user:
packages/api/src/users/services.ts#L30
TRPCError: relation "users" does not exist
❯ ../../node_modules/pg-pool/index.js:45:11
❯ ../../node_modules/src/node-postgres/session.ts:66:19
❯ Module.getUser src/users/services.ts:30:23
❯ src/users/router.ts:11:18
❯ resolveMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'INTERNAL_SERVER_ERROR' }
Caused by: error: relation "users" does not exist
❯ ../../node_modules/pg-pool/index.js:45:11
❯ ../../node_modules/src/node-postgres/session.ts:66:19
❯ Module.getUser src/users/services.ts:30:23
❯ src/users/router.ts:11:18
❯ resolveMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { length: 105, severity: 'ERROR', code: '42P01', detail: undefined, hint: undefined, position: '178', internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'parse_relation.c', line: '1452', routine: 'parserOpenTable' }
|
src/users/router.test.ts > getUserProcedure > should not get an invalid user:
packages/api/src/users/services.ts#L30
TRPCError: relation "users" does not exist
❯ ../../node_modules/pg-pool/index.js:45:11
❯ ../../node_modules/src/node-postgres/session.ts:66:19
❯ Module.getUser src/users/services.ts:30:23
❯ src/users/router.ts:11:18
❯ resolveMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'INTERNAL_SERVER_ERROR' }
Caused by: error: relation "users" does not exist
❯ ../../node_modules/pg-pool/index.js:45:11
❯ ../../node_modules/src/node-postgres/session.ts:66:19
❯ Module.getUser src/users/services.ts:30:23
❯ src/users/router.ts:11:18
❯ resolveMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { length: 105, severity: 'ERROR', code: '42P01', detail: undefined, hint: undefined, position: '178', internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'parse_relation.c', line: '1452', routine: 'parserOpenTable' }
|
src/users/router.test.ts > upsertUserProcedure > inserts a user:
packages/api/src/users/router.ts#L28
TRPCError: error upserting user
❯ src/users/router.ts:28:13
❯ resolveMiddleware ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:103:30
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ callRecursive ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:153:32
❯ procedure ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:183:24
❯ ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs:111:28
❯ src/users/router.test.ts:49:18
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'INTERNAL_SERVER_ERROR' }
|
test
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: pnpm/action-setup@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|