From d9f2e4b1f183a266153760a12e1008d5084fad73 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Thu, 12 Mar 2026 14:47:12 +0100 Subject: [PATCH] feat(functions-tools): tweak api for cli --- packages/functions-tools/src/api/zod/index.ts | 9 +- .../src/api/zod/services/parser.services.ts | 19 +- .../functions-tools/src/functions/index.ts | 8 +- packages/functions-tools/src/index.ts | 2 +- .../api/zod/services/parser.services.spec.ts | 219 +++++------------- 5 files changed, 67 insertions(+), 190 deletions(-) diff --git a/packages/functions-tools/src/api/zod/index.ts b/packages/functions-tools/src/api/zod/index.ts index ba5951e8f..3cc04841d 100644 --- a/packages/functions-tools/src/api/zod/index.ts +++ b/packages/functions-tools/src/api/zod/index.ts @@ -4,19 +4,16 @@ import type {TransformerOptions} from '../types/transformer-options'; import {parseZodApi} from './services/parser.services'; export const generateZodApi = async ({ - queries, - updates, + functions, outputFile, transformerOptions }: { - queries: [string, Query][]; - updates: [string, Update][]; + functions: [string, Update | Query][]; outputFile: string; transformerOptions: TransformerOptions; }) => { const api = parseZodApi({ - queries, - updates, + functions, transformerOptions }); diff --git a/packages/functions-tools/src/api/zod/services/parser.services.ts b/packages/functions-tools/src/api/zod/services/parser.services.ts index 919a527be..70b76ba41 100644 --- a/packages/functions-tools/src/api/zod/services/parser.services.ts +++ b/packages/functions-tools/src/api/zod/services/parser.services.ts @@ -33,25 +33,18 @@ const template = `// This file was automatically generated by the Juno CLI. %NAMESPACE%`; export const parseZodApi = ({ - queries, - updates, + functions: devFunctions, transformerOptions: {coreLib, outputLanguage} }: { - queries: [string, Query][]; - updates: [string, Update][]; + functions: [string, Update | Query][]; transformerOptions: TransformerOptions; }): string => { - const templateQueries = queries + const functions = devFunctions .map(([jsFnName, fn]) => parseApi({jsFnName, fn, outputLanguage})) - .join('\n\n'); - - const templateUpdates = updates - .map(([jsFnName, fn]) => parseApi({jsFnName, fn, outputLanguage})) - .join('\n\n'); - - const functions = `${templateQueries}\n\n${templateUpdates}`.trim(); + .join('\n\n') + .trim(); - const functionNames = [...queries, ...updates].map(([jsFnName, _]) => jsFnName).join(',\n\t'); + const functionNames = devFunctions.map(([jsFnName, _]) => jsFnName).join(',\n\t'); const namespaceExport = templateNamespace .replace('%FUNCTION_NAMESPACE%', FRONTEND_FUNCTION_NAMESPACE) diff --git a/packages/functions-tools/src/functions/index.ts b/packages/functions-tools/src/functions/index.ts index 242585130..185014409 100644 --- a/packages/functions-tools/src/functions/index.ts +++ b/packages/functions-tools/src/functions/index.ts @@ -9,8 +9,8 @@ export interface GenerateFunctionsArgs { } export interface GenerateFunctionsData { - totalQueries: number; - totalUpdates: number; + queries: [string, Query][]; + updates: [string, Update][]; outputPath: string; } @@ -73,8 +73,8 @@ export const generateFunctions = async ({ return { outputPath: relative(process.cwd(), outputFile), - totalQueries: queries.length, - totalUpdates: updates.length + queries, + updates }; } finally { globalThis.console = originalConsole; diff --git a/packages/functions-tools/src/index.ts b/packages/functions-tools/src/index.ts index cfc05d40d..17308a981 100644 --- a/packages/functions-tools/src/index.ts +++ b/packages/functions-tools/src/index.ts @@ -1,3 +1,3 @@ -export * from './api/idl'; +export * from './api'; export * from './converters'; export * from './functions'; diff --git a/packages/functions-tools/src/tests/api/zod/services/parser.services.spec.ts b/packages/functions-tools/src/tests/api/zod/services/parser.services.spec.ts index e68b42f04..81ac3aacd 100644 --- a/packages/functions-tools/src/tests/api/zod/services/parser.services.spec.ts +++ b/packages/functions-tools/src/tests/api/zod/services/parser.services.spec.ts @@ -29,8 +29,7 @@ describe('zod-api-parser', () => { describe('file header', () => { it('should include generated comment', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('// This file was automatically generated by the Juno CLI.'); @@ -39,8 +38,7 @@ describe('zod-api-parser', () => { it('should include eslint-disable comment', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('/* eslint-disable */'); @@ -48,8 +46,7 @@ describe('zod-api-parser', () => { it('should include prettier-ignore comment', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('/* prettier-ignore */'); @@ -57,8 +54,7 @@ describe('zod-api-parser', () => { it('should import SatelliteActor from satellite.did for ts', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain("import type {_SERVICE as SatelliteActor} from './satellite.did';"); @@ -66,8 +62,7 @@ describe('zod-api-parser', () => { it('should not import SatelliteActor for js', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result).not.toContain('import type {_SERVICE as SatelliteActor}'); @@ -75,8 +70,7 @@ describe('zod-api-parser', () => { it('should import z from zod for ts', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain("import * as z from 'zod';"); @@ -84,8 +78,7 @@ describe('zod-api-parser', () => { it('should import z from zod for js', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result).toContain("import * as z from 'zod';"); @@ -93,8 +86,7 @@ describe('zod-api-parser', () => { it('should import recursiveToNullable and recursiveFromNullable', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsWithResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain( @@ -104,8 +96,7 @@ describe('zod-api-parser', () => { it('should import from core by default', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain("import {getSatelliteExtendedActor} from '@junobuild/core';"); @@ -113,8 +104,7 @@ describe('zod-api-parser', () => { it('should import from core-standalone when specified', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts', coreLib: 'core-standalone'} }); expect(result).toContain( @@ -124,8 +114,7 @@ describe('zod-api-parser', () => { it('should import idlFactory from satellite.factory.did.js for ts', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain("import {idlFactory} from './satellite.factory.did.js';"); @@ -133,8 +122,7 @@ describe('zod-api-parser', () => { it('should import idlFactory from satellite.factory.did.js for js', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result).toContain("import {idlFactory} from './satellite.factory.did.js';"); @@ -146,8 +134,7 @@ describe('zod-api-parser', () => { describe('no args no result', () => { it('should generate ts function with no args and no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('const helloWorld = async (): Promise'); @@ -158,8 +145,7 @@ describe('zod-api-parser', () => { it('should generate js function with no args and no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result).toContain('const helloWorld = async ()'); @@ -173,8 +159,7 @@ describe('zod-api-parser', () => { describe('args only', () => { it('should generate ts function with args and no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain( @@ -190,8 +175,7 @@ describe('zod-api-parser', () => { it('should generate js function with args and no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsNoResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result).toContain( @@ -208,8 +192,7 @@ describe('zod-api-parser', () => { describe('result only', () => { it('should generate ts function with no args and result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsWithResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain( @@ -225,8 +208,7 @@ describe('zod-api-parser', () => { it('should generate js function with no args and result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsWithResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result).toContain( @@ -243,8 +225,7 @@ describe('zod-api-parser', () => { describe('args and result', () => { it('should generate ts function with args and result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsWithResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain( @@ -266,8 +247,7 @@ describe('zod-api-parser', () => { it('should generate js function with args and result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsWithResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result).toContain('const AppHelloWorldArgsSchema'); @@ -281,10 +261,9 @@ describe('zod-api-parser', () => { // ─── namespace export ──────────────────────────────────────────────────────── describe('namespace export', () => { - it('should export functions namespace', () => { + it('should export functions namespace for ts', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('export const functions = {'); @@ -293,51 +272,26 @@ describe('zod-api-parser', () => { it('should export functions namespace for js', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result).toContain('export const functions = {'); expect(result).toContain('helloWorld'); }); - it('should include all query functions in namespace', () => { + it('should include multiple functions in namespace', () => { const result = parseZodApi({ - queries: [ + functions: [ ['getUser', mockQueryNoArgsWithResult], - ['listUsers', mockQueryNoArgsWithResult] - ], - updates: [], - transformerOptions: {outputLanguage: 'ts'} - }); - expect(result).toContain('export const functions = {'); - expect(result).toContain('getUser'); - expect(result).toContain('listUsers'); - }); - - it('should include all update functions in namespace', () => { - const result = parseZodApi({ - queries: [], - updates: [ - ['createUser', mockQueryWithArgsNoResult], + ['setUser', mockQueryWithArgsNoResult], ['deleteUser', mockQueryWithArgsNoResult] ], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('export const functions = {'); - expect(result).toContain('createUser'); - expect(result).toContain('deleteUser'); - }); - - it('should include both queries and updates in namespace', () => { - const result = parseZodApi({ - queries: [['getUser', mockQueryNoArgsWithResult]], - updates: [['setUser', mockQueryWithArgsNoResult]], - transformerOptions: {outputLanguage: 'ts'} - }); - expect(result).toContain('export const functions = {'); expect(result).toContain('getUser'); expect(result).toContain('setUser'); + expect(result).toContain('deleteUser'); }); }); @@ -346,8 +300,7 @@ describe('zod-api-parser', () => { describe('rs function name', () => { it('should convert camelCase to snake_case with namespace prefix', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('app_hello_world'); @@ -355,8 +308,7 @@ describe('zod-api-parser', () => { it('should handle single word function name', () => { const result = parseZodApi({ - queries: [['greet', mockQueryNoArgsNoResult]], - updates: [], + functions: [['greet', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('app_greet'); @@ -364,8 +316,7 @@ describe('zod-api-parser', () => { it('should handle long camelCase function name', () => { const result = parseZodApi({ - queries: [['getSatelliteConfig', mockQueryNoArgsNoResult]], - updates: [], + functions: [['getSatelliteConfig', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('app_get_satellite_config'); @@ -377,8 +328,7 @@ describe('zod-api-parser', () => { describe('schema naming', () => { it('should prefix schema with FUNCTION_NAMESPACE and capitalize', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsWithResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('AppHelloWorldArgsSchema'); @@ -387,8 +337,7 @@ describe('zod-api-parser', () => { it('should handle single word function name in schema', () => { const result = parseZodApi({ - queries: [['greet', mockQueryWithArgsWithResult]], - updates: [], + functions: [['greet', mockQueryWithArgsWithResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('AppGreetArgsSchema'); @@ -396,59 +345,16 @@ describe('zod-api-parser', () => { }); }); - // ─── queries vs updates ────────────────────────────────────────────────────── - - describe('queries vs updates', () => { - it('should generate functions for queries', () => { - const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsWithResult]], - updates: [], - transformerOptions: {outputLanguage: 'ts'} - }); - expect(result).toContain('const helloWorld'); - }); - - it('should generate functions for updates', () => { - const result = parseZodApi({ - queries: [], - updates: [['helloWorld', mockQueryWithArgsWithResult]], - transformerOptions: {outputLanguage: 'ts'} - }); - expect(result).toContain('const helloWorld'); - }); - - it('should generate functions for both queries and updates', () => { - const result = parseZodApi({ - queries: [['getUser', mockQueryNoArgsWithResult]], - updates: [['setUser', mockQueryWithArgsNoResult]], - transformerOptions: {outputLanguage: 'ts'} - }); - expect(result).toContain('const getUser'); - expect(result).toContain('const setUser'); - }); - - it('should handle empty queries and updates', () => { - const result = parseZodApi({ - queries: [], - updates: [], - transformerOptions: {outputLanguage: 'ts'} - }); - expect(result).toContain('// This file was automatically generated'); - expect(result).not.toContain('const helloWorld'); - }); - }); - // ─── multiple functions ────────────────────────────────────────────────────── describe('multiple functions', () => { - it('should generate multiple query functions', () => { + it('should generate multiple functions', () => { const result = parseZodApi({ - queries: [ + functions: [ ['getUser', mockQueryNoArgsWithResult], ['listUsers', mockQueryNoArgsWithResult], ['searchUsers', mockQueryWithArgsWithResult] ], - updates: [], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('const getUser'); @@ -456,17 +362,13 @@ describe('zod-api-parser', () => { expect(result).toContain('const searchUsers'); }); - it('should generate multiple update functions', () => { + it('should handle empty functions', () => { const result = parseZodApi({ - queries: [], - updates: [ - ['createUser', mockQueryWithArgsNoResult], - ['deleteUser', mockQueryWithArgsNoResult] - ], + functions: [], transformerOptions: {outputLanguage: 'ts'} }); - expect(result).toContain('const createUser'); - expect(result).toContain('const deleteUser'); + expect(result).toContain('// This file was automatically generated'); + expect(result).not.toContain('const helloWorld'); }); }); @@ -475,8 +377,7 @@ describe('zod-api-parser', () => { describe('schema types', () => { it('should handle principal in args', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithPrincipal]], - updates: [], + functions: [['helloWorld', mockQueryWithPrincipal]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('PrincipalSchema'); @@ -484,8 +385,7 @@ describe('zod-api-parser', () => { it('should handle Uint8Array in args', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithUint8Array]], - updates: [], + functions: [['helloWorld', mockQueryWithUint8Array]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('Uint8ArraySchema'); @@ -493,8 +393,7 @@ describe('zod-api-parser', () => { it('should handle array fields', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArray]], - updates: [], + functions: [['helloWorld', mockQueryWithArray]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain('z.array(z.string())'); @@ -502,8 +401,7 @@ describe('zod-api-parser', () => { it('should handle enum fields', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithEnum]], - updates: [], + functions: [['helloWorld', mockQueryWithEnum]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain("z.enum(['active', 'inactive'])"); @@ -511,8 +409,7 @@ describe('zod-api-parser', () => { it('should handle nested objects', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithNestedObject]], - updates: [], + functions: [['helloWorld', mockQueryWithNestedObject]], transformerOptions: {outputLanguage: 'ts'} }); expect(result).toContain( @@ -526,8 +423,7 @@ describe('zod-api-parser', () => { describe('full output', () => { it('should match ts no args no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result.trim()).toContain(mockTsNoArgsNoResult); @@ -535,8 +431,7 @@ describe('zod-api-parser', () => { it('should match ts with args no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result.trim()).toContain(mockTsWithArgsNoResult); @@ -544,8 +439,7 @@ describe('zod-api-parser', () => { it('should match ts no args with result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsWithResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result.trim()).toContain(mockTsNoArgsWithResult); @@ -553,8 +447,7 @@ describe('zod-api-parser', () => { it('should match ts with args and result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsWithResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result.trim()).toContain(mockTsWithArgsWithResult); @@ -562,8 +455,7 @@ describe('zod-api-parser', () => { it('should match js no args no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result.trim()).toContain(mockJsNoArgsNoResult); @@ -571,8 +463,7 @@ describe('zod-api-parser', () => { it('should match js with args no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsNoResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result.trim()).toContain(mockJsWithArgsNoResult); @@ -580,8 +471,7 @@ describe('zod-api-parser', () => { it('should match js no args with result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsWithResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result.trim()).toContain(mockJsNoArgsWithResult); @@ -589,8 +479,7 @@ describe('zod-api-parser', () => { it('should match js with args and result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryWithArgsWithResult]], - updates: [], + functions: [['helloWorld', mockQueryWithArgsWithResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result.trim()).toContain(mockJsWithArgsWithResult); @@ -598,8 +487,7 @@ describe('zod-api-parser', () => { it('should match full ts output no args no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'ts'} }); expect(result.trim()).toEqual(mockTsFullNoArgsNoResult); @@ -607,8 +495,7 @@ describe('zod-api-parser', () => { it('should match full js output no args no result', () => { const result = parseZodApi({ - queries: [['helloWorld', mockQueryNoArgsNoResult]], - updates: [], + functions: [['helloWorld', mockQueryNoArgsNoResult]], transformerOptions: {outputLanguage: 'js'} }); expect(result.trim()).toEqual(mockJsFullNoArgsNoResult);