From a54f4293660b3bc48ab974d8e64190daf88b3c42 Mon Sep 17 00:00:00 2001 From: pinocchio-life-like Date: Sun, 29 Dec 2024 20:17:32 +0300 Subject: [PATCH] resolve github actions failure --- .../packTemplate/addPackTemplateService.ts | 2 +- server/src/swaggerOptions.ts | 18 ++++++++---------- server/src/tests/routes/favorite.spec.ts | 5 ++++- server/src/tests/routes/item.spec.ts | 5 ++++- server/src/tests/routes/osm.spec.ts | 5 ++++- server/src/tests/routes/pack.spec.ts | 5 ++++- server/src/tests/routes/packTemplate.spec.ts | 5 ++++- server/src/tests/routes/template.spec.ts | 5 ++++- server/src/tests/routes/trip.spec.ts | 5 ++++- 9 files changed, 37 insertions(+), 18 deletions(-) diff --git a/server/src/services/packTemplate/addPackTemplateService.ts b/server/src/services/packTemplate/addPackTemplateService.ts index 0899ad9b6..1a3e9eaa7 100644 --- a/server/src/services/packTemplate/addPackTemplateService.ts +++ b/server/src/services/packTemplate/addPackTemplateService.ts @@ -23,7 +23,7 @@ export const addPackTemplateService = async ( type: '', itemPackTemplates: [], itemsOwnerId: '', - } as validator.AddPackTemplateType, + } as const, executionCtx: ExecutionContext, ): Promise => { const { name, description, type } = packTemplateData; diff --git a/server/src/swaggerOptions.ts b/server/src/swaggerOptions.ts index a7023359e..c857de3e5 100644 --- a/server/src/swaggerOptions.ts +++ b/server/src/swaggerOptions.ts @@ -1,9 +1,7 @@ -// @ts-nocheck - -import TripSchema from './models/tripModel'; -import PackSchema from './models/packModel'; -import ItemSchema from './models/itemModel'; -import UserSchema from './models/userModel'; +import { trip } from './db/schema'; +import { pack } from './db/schema'; +import { item } from './db/schema'; +import { user } from './db/schema'; import m2s from 'mongoose-to-swagger'; import swaggerJsdoc from 'swagger-jsdoc'; @@ -49,10 +47,10 @@ const specs: any = swaggerJsdoc(options); // Add the schemas generated by mongoose-to-swagger to the components.schemas property of the specs object specs.components = { schemas: { - User: m2s(UserSchema), - Trip: m2s(TripSchema), - Pack: m2s(PackSchema), - Item: m2s(ItemSchema), + User: m2s(user), + Trip: m2s(trip), + Pack: m2s(pack), + Item: m2s(item), }, }; diff --git a/server/src/tests/routes/favorite.spec.ts b/server/src/tests/routes/favorite.spec.ts index a23ba39cb..c0245ea2c 100644 --- a/server/src/tests/routes/favorite.spec.ts +++ b/server/src/tests/routes/favorite.spec.ts @@ -15,7 +15,10 @@ describe('Favorite routes', () => { let pack: Pack; beforeAll(async () => { - const executionCtx = {} as ExecutionContext; + const executionCtx: ExecutionContext = { + waitUntil: () => {}, + passThroughOnException: () => {}, + }; caller = await setupTest(env, executionCtx); user = (await userClass.create({ email: 'test@abc.com', diff --git a/server/src/tests/routes/item.spec.ts b/server/src/tests/routes/item.spec.ts index 24afe9718..c5267427c 100644 --- a/server/src/tests/routes/item.spec.ts +++ b/server/src/tests/routes/item.spec.ts @@ -42,7 +42,10 @@ describe('Item routes', () => { let owner: User; beforeAll(async () => { - const executionCtx = {} as ExecutionContext; + const executionCtx: ExecutionContext = { + waitUntil: () => {}, + passThroughOnException: () => {}, + }; caller = await setupTest(env, executionCtx); pack = await packClass.create({ name: 'test', diff --git a/server/src/tests/routes/osm.spec.ts b/server/src/tests/routes/osm.spec.ts index 53dcb1375..589f9fc03 100644 --- a/server/src/tests/routes/osm.spec.ts +++ b/server/src/tests/routes/osm.spec.ts @@ -18,7 +18,10 @@ describe('OSM routes', () => { const nodeClass = new NodeClass(); beforeAll(async () => { - const executionCtx = {} as ExecutionContext; + const executionCtx: ExecutionContext = { + waitUntil: () => {}, + passThroughOnException: () => {}, + }; caller = await setupTest(env, executionCtx); }); diff --git a/server/src/tests/routes/pack.spec.ts b/server/src/tests/routes/pack.spec.ts index a8a803b9e..815f1fc56 100644 --- a/server/src/tests/routes/pack.spec.ts +++ b/server/src/tests/routes/pack.spec.ts @@ -40,7 +40,10 @@ describe('Pack routes', () => { let owner: User; beforeAll(async () => { - executionCtx = {} as ExecutionContext; + const executionCtx: ExecutionContext = { + waitUntil: () => {}, + passThroughOnException: () => {}, + }; caller = await setupTest(env, executionCtx); owner = (await userClass.create({ email: 'test@abc.com', diff --git a/server/src/tests/routes/packTemplate.spec.ts b/server/src/tests/routes/packTemplate.spec.ts index 1b4f13d24..3c387d832 100644 --- a/server/src/tests/routes/packTemplate.spec.ts +++ b/server/src/tests/routes/packTemplate.spec.ts @@ -44,7 +44,10 @@ describe('Pack template routes', () => { let packTemplateItems: Item[]; beforeAll(async () => { - const executionCtx = {} as ExecutionContext; + const executionCtx: ExecutionContext = { + waitUntil: () => {}, + passThroughOnException: () => {}, + }; caller = await setupTest(env, executionCtx); vi.resetModules(); diff --git a/server/src/tests/routes/template.spec.ts b/server/src/tests/routes/template.spec.ts index 18756aa0e..ef0213d65 100644 --- a/server/src/tests/routes/template.spec.ts +++ b/server/src/tests/routes/template.spec.ts @@ -14,7 +14,10 @@ describe('Template Routes', () => { let createdTemplate: Template; beforeAll(async () => { - const executionCtx = {} as ExecutionContext; + const executionCtx: ExecutionContext = { + waitUntil: () => {}, + passThroughOnException: () => {}, + }; caller = await setupTest(env, executionCtx); }); diff --git a/server/src/tests/routes/trip.spec.ts b/server/src/tests/routes/trip.spec.ts index 78dcdbd2d..9f2836101 100644 --- a/server/src/tests/routes/trip.spec.ts +++ b/server/src/tests/routes/trip.spec.ts @@ -17,7 +17,10 @@ describe('Trip Routes', () => { let owner: User; beforeAll(async () => { - const executionCtx = {} as ExecutionContext; + const executionCtx: ExecutionContext = { + waitUntil: () => {}, + passThroughOnException: () => {}, + }; caller = await setupTest(env, executionCtx); owner = (await userClass.create({ email: 'test@abc.com',