CallePuzzle / donde-esta-tu-local

Aplicación para saber donde están las peñas de tu pueblo
1 stars 0 forks source link

Arreglar tests #58

Closed jilgue closed 2 months ago

jilgue commented 2 months ago

He tenido que quitar esto porque si no no funciona el build:

/home/cesar/projects/donde-esta-tu-local/node_modules/wrangler/wrangler-dist/cli.js:29768
            throw a;
            ^
Error: Invalid export 'RequestNewMember' in src/routes/gang/[slug]/+page.server.ts (valid exports are load, prerender, csr, ssr, trailingSlash, config, actions, entries, or anything with a '_' prefix)
    at validate (file:///home/cesar/projects/donde-esta-tu-local/node_modules/@sveltejs/kit/src/utils/exports.js:21:10)
    at analyse_page (file:///home/cesar/projects/donde-esta-tu-local/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js:184:2)
    at analyse (file:///home/cesar/projects/donde-esta-tu-local/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js:79:4)
    at async MessagePort.<anonymous> (file:///home/cesar/projects/donde-esta-tu-local/node_modules/@sveltejs/kit/src/utils/fork.js:22:16)
Emitted 'error' event on Worker instance at:
    at [kOnErrorMessage] (node:internal/worker:326:10)
    at [kOnMessage] (node:internal/worker:337:37)
    at MessagePort.<anonymous> (node:internal/worker:232:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)
    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)

Node.js v20.15.0
diff --git a/src/routes/gang/[slug]/+page.server.ts b/src/routes/gang/[slug]/+page.server.ts
index 01c2efd..9120bda 100644
--- a/src/routes/gang/[slug]/+page.server.ts
+++ b/src/routes/gang/[slug]/+page.server.ts
@@ -78,10 +78,6 @@ async function requestNewMember(prisma: PrismaClient, gangId: number, userId: st
        };
 }

-export async function RequestNewMember(prisma: PrismaClient, gangId: number, userId: string) {
-       return requestNewMember(prisma, gangId, userId);
-}
-
 export const load: PageServerLoad = async (event) => {
        const db = event.platform!.env.DB;
        const prisma = initializePrisma(db);
diff --git a/src/routes/gang/add/+page.server.ts b/src/routes/gang/add/+page.server.ts
index 0273e35..7e82ef2 100644
--- a/src/routes/gang/add/+page.server.ts
+++ b/src/routes/gang/add/+page.server.ts
@@ -68,15 +68,3 @@ async function addGang(
                message: 'Peña añadida, a la espera de revisión por un administrador'
        };
 }
-
-export async function TestAddGang(
-       prisma: PrismaClient,
-       userId: string,
-       name: string,
-       lat: string,
-       lng: string
-) {
-       if (process.env.NODE_ENV === 'test') {
-               return addGang(prisma, userId, name, lat, lng);
-       }
-}