import * as types from '../index' ; import { TestUserInput } from './TestUserInput' ; export async function createTestActionContext ( ) { return { telemetry : { properties : { } , measurements : { } } , errorHandling : { issueProperties : { } } , valuesToMask : [ ] , ui : await TestUserInput . create ( ) } ; } /**
 * Similar to `createTestActionContext` but with some extra logging
 */ export async function runWithTestActionContext ( callbackId , callback ) { const context = await createTestActionContext ( ) ; const start = Date . now ( ) ; try { await callback ( context ) ; } finally { const end = Date . now ( ) ; context . telemetry . measurements . duration = ( end - start ) / 1000 ; console . log ( `** TELEMETRY(${ callbackId }) properties=${ JSON . stringify ( context . telemetry . properties ) }, measurements=${ JSON . stringify ( context . telemetry . measurements ) }` ) ; } }