import { CategoryData , ScriptData , CollectionData , ScriptingDefinitionData , FunctionData , } from 'js-yaml-loader!@/*' ; import { RecommendationLevel } from '@/domain/RecommendationLevel' ; import { ScriptingLanguage } from '@/domain/ScriptingLanguage' ; export class CollectionDataStub implements CollectionData { public os = 'windows' ; public actions : readonly CategoryData [ ] = [ getCategoryStub ( ) ] ; public scripting : ScriptingDefinitionData = getTestDefinitionStub ( ) ; public functions ? : ReadonlyArray < FunctionData > ; public withActions ( actions ) { this . actions = actions ; return this ; } public withOs ( os ) { this . os = os ; return this ; } public withScripting ( scripting ) { this . scripting = scripting ; return this ; } public withFunctions ( functions ) { this . functions = functions ; return this ; } } export function getCategoryStub ( scriptPrefix = 'testScript' ) { return { category : 'category name' , children : [ getScriptStub ( `${ scriptPrefix }-standard` , RecommendationLevel . Standard ) , getScriptStub ( `${ scriptPrefix }-strict` , RecommendationLevel . Strict ) , ] , } ; } function getTestDefinitionStub ( ) { return { fileExtension : '.bat' , language : ScriptingLanguage [ ScriptingLanguage . batchfile ] , startCode : 'start' , endCode : 'end' , } ; } function getScriptStub ( scriptName , level = RecommendationLevel . Standard ) { return { name : scriptName , code : 'script code' , revertCode : 'revert code' , recommend : RecommendationLevel [ level ] . toLowerCase ( ) , call : undefined , } ; }