From 5e16be93ac9a3767a32d9be661dc759a6aab1942 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 10 Oct 2023 13:24:27 -0700 Subject: [PATCH] Fix automated testing suite (#3880) * Move assert in if clause * Fix remaining tests (hopefully) --- src/templates/dotnet/parseDotnetTemplates.ts | 2 +- test/project/createNewProject.test.ts | 3 ++- test/project/createNewProjectApi.test.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/templates/dotnet/parseDotnetTemplates.ts b/src/templates/dotnet/parseDotnetTemplates.ts index 24e855cf2..1470d5f84 100644 --- a/src/templates/dotnet/parseDotnetTemplates.ts +++ b/src/templates/dotnet/parseDotnetTemplates.ts @@ -128,9 +128,9 @@ async function copyCSharpSettingsFromJS(csharpTemplates: IFunctionTemplate[], ve const normalizedDotnetId = normalizeDotnetId(csharpTemplate.id); const jsTemplate: FunctionTemplateBase | undefined = jsTemplates.find((t: IFunctionTemplate) => normalizeScriptId(t.id) === normalizedDotnetId); - assertTemplateIsV1(jsTemplate); if (jsTemplate) { + assertTemplateIsV1(jsTemplate); csharpTemplate.name = jsTemplate.name; csharpTemplate.defaultFunctionName = jsTemplate.defaultFunctionName; for (const cSharpSetting of csharpTemplate.userPromptedSettings) { diff --git a/test/project/createNewProject.test.ts b/test/project/createNewProject.test.ts index 96e8af5c6..5bc4b69d8 100644 --- a/test/project/createNewProject.test.ts +++ b/test/project/createNewProject.test.ts @@ -34,9 +34,10 @@ for (const version of [FuncVersion.v2, FuncVersion.v3, FuncVersion.v4]) { { ...getDotnetScriptValidateOptions(ProjectLanguage.FSharpScript, version), isHiddenLanguage: true }, ); + // test python v1 model testCases.push({ ...getPythonValidateOptions('.venv', version), - inputs: [TestInput.UseDefaultValue] + inputs: [/Model V1/i, TestInput.UseDefaultValue] }); const appName: string = 'javaApp'; diff --git a/test/project/createNewProjectApi.test.ts b/test/project/createNewProjectApi.test.ts index 1c4dc7b01..ca4ce3132 100644 --- a/test/project/createNewProjectApi.test.ts +++ b/test/project/createNewProjectApi.test.ts @@ -15,7 +15,7 @@ suite('Create New Project API (deprecated)', () => { test('JavaScript', async () => { const projectPath: string = path.join(testFolderPath, 'createNewProjectApi'); const commandId = 'azureFunctions.createNewProject'; - await runWithInputs(commandId, [/Model V3/, /skip for now/i], registerOnActionStartHandler, async () => { + await runWithInputs(commandId, [/skip for now/i], registerOnActionStartHandler, async () => { await vscode.commands.executeCommand(commandId, projectPath, 'JavaScript', '~2', false /* openFolder */); }); await validateProject(projectPath, getJavaScriptValidateOptions(true /* hasPackageJson */, FuncVersion.v2));