From 97d8ce31414b91791357b31c484e620e293ffb50 Mon Sep 17 00:00:00 2001 From: Ingrid Fielker Date: Wed, 14 Aug 2024 17:04:00 -0400 Subject: [PATCH] more testing fixes --- scripts/bin-test/run.sh | 9 ++++++++- scripts/bin-test/test.ts | 12 +++++++----- spec/fixtures/extsdk/translate/index.d.ts | 3 +-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/scripts/bin-test/run.sh b/scripts/bin-test/run.sh index aa10b4286..8998ad6f1 100755 --- a/scripts/bin-test/run.sh +++ b/scripts/bin-test/run.sh @@ -5,10 +5,17 @@ set -ex # Immediately exit on failure npm run build npm link -# Link local SDK to all test sources. +# Link the extensions SDKs for the testing environment. +(cd scripts/bin-test/extsdks/local && npm link) +(cd scripts/bin-test/extsdks/translate && npm link) +(cd scripts/bin-test/extsdks/translate && npm link firebase-functions) + +# Link SDKs to all test sources. for f in scripts/bin-test/sources/*; do if [ -d "$f" ]; then (cd "$f" && npm link firebase-functions) + (cd "$f" && npm link @firebase-extensions/firebase-firestore-translate-text-sdk) + (cd "$f" && npm link @firebase-extensions/local-backfill-sdk) fi done diff --git a/scripts/bin-test/test.ts b/scripts/bin-test/test.ts index 744e98a85..85b2eb249 100644 --- a/scripts/bin-test/test.ts +++ b/scripts/bin-test/test.ts @@ -44,7 +44,7 @@ const BASE_EXTENSIONS = { DO_BACKFILL: "False", LOCATION: "us-central1", }, - localPath: "./functions/generated/extensions/local/backfill0.0.2/src", + localPath: "./functions/generated/extensions/local/backfill/0.0.2/src", events: [], }, }; @@ -306,10 +306,12 @@ describe("functions.yaml", function () { }, }, }, - requiredAPIs: [{ - api: "eventarcpublishing.googleapis.com", - reason: "Needed for custom event functions", - },], + requiredAPIs: [ + { + api: "eventarcpublishing.googleapis.com", + reason: "Needed for custom event functions", + }, + ], specVersion: "v1alpha1", extensions: BASE_EXTENSIONS, }, diff --git a/spec/fixtures/extsdk/translate/index.d.ts b/spec/fixtures/extsdk/translate/index.d.ts index 96b86dcc3..8e5cee195 100644 --- a/spec/fixtures/extsdk/translate/index.d.ts +++ b/spec/fixtures/extsdk/translate/index.d.ts @@ -119,5 +119,4 @@ export declare class FirestoreTranslateText { * Occurs when the function is settled. Provides no customized data other than the context. */ onCompletion(callback: EventCallback, options?: SimpleEventarcTriggerOptions): import("firebase-functions/v2").CloudFunction>; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file +} \ No newline at end of file