import * as path from 'path' ; import * as vscode from 'vscode' ; import { runWithInputs } from 'vscode-azureextensiondev' ; import { FuncVersion , registerOnActionStartHandler } from '../../extension.bundle' ; import { longRunningTestsEnabled , testFolderPath } from '../global.test' ; import { getCSharpValidateOptions , getJavaScriptValidateOptions , validateProject } from './validateProject' ; suite ( 'Create New Project API (deprecated)' , ( ) => { test ( 'JavaScript' , async ( ) => { const projectPath = path . join ( testFolderPath , 'createNewProjectApi' ) ; const commandId = 'azureFunctions.createNewProject' ; await runWithInputs ( commandId , [ /skip for now/i ] , registerOnActionStartHandler , async ( ) => { await vscode . commands . executeCommand ( commandId , projectPath , 'JavaScript' , '~2' , false ) ; } ) ; await validateProject ( projectPath , getJavaScriptValidateOptions ( true , FuncVersion . v2 ) ) ; } ) ; test ( 'C# Script IoT' , async function ( this ) : Promise < void > { if ( ! longRunningTestsEnabled ) { this . skip ( ) ; } this . timeout ( 5 * 60 * 1000 ) ; const templateId = 'Azure.Function.CSharp.IotHubTrigger.2.x' ; const functionName = 'createFunctionApi' ; const namespace = 'Company.Function' ; const iotPath = 'messages/events' ; const connection = 'IoTHub_Setting' ; const projectPath = path . join ( testFolderPath , 'createNewProjectApiCSharp' ) ; await vscode . commands . executeCommand ( 'azureFunctions.createNewProject' , projectPath , 'C#' , '~2' , false , templateId , functionName , { namespace : namespace , Path : iotPath , Connection : connection } ) ; await validateProject ( projectPath , getCSharpValidateOptions ( 'netcoreapp2.1' , FuncVersion . v2 ) ) ; } ) ; } ) ;