Skip to content

Commit

Permalink
Fix automated testing suite (#3880)
Browse files Browse the repository at this point in the history
* Move assert in if clause

* Fix remaining tests (hopefully)
  • Loading branch information
nturinski authored Oct 10, 2023
1 parent 5f83dde commit 5e16be9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/templates/dotnet/parseDotnetTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion test/project/createNewProject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion test/project/createNewProjectApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 5e16be9

Please sign in to comment.