< Summary

Information
Class: Elsa.Expressions.JavaScript.Activities.RunJavaScriptFunctionsDefinitionProvider
Assembly: Elsa.Expressions.JavaScript
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/Activities/RunJavaScript/RunJavaScriptFunctionsDefinitionProvider.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 13
Coverable lines: 13
Total lines: 33
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetFunctionDefinitions()0%2040%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/Activities/RunJavaScript/RunJavaScriptFunctionsDefinitionProvider.cs

#LineLine coverage
 1using Elsa.Expressions.JavaScript.TypeDefinitions.Abstractions;
 2using Elsa.Expressions.JavaScript.TypeDefinitions.Models;
 3using Elsa.Workflows.Helpers;
 4using JetBrains.Annotations;
 5
 6// ReSharper disable once CheckNamespace
 7namespace Elsa.Expressions.JavaScript.Activities;
 8
 9/// <summary>
 10/// Produces <see cref="FunctionDefinition"/>s for common functions.
 11/// </summary>
 12[UsedImplicitly]
 13internal class RunJavaScriptFunctionsDefinitionProvider : FunctionDefinitionProvider
 14{
 15    protected override IEnumerable<FunctionDefinition> GetFunctionDefinitions(TypeDefinitionContext context)
 16    {
 017        if (context.ActivityTypeName != ActivityTypeNameHelper.GenerateTypeName<RunJavaScript>())
 018            yield break;
 19
 020        if(context.PropertyName != nameof(RunJavaScript.Script))
 021            yield break;
 22
 023        yield return CreateFunctionDefinition(builder => builder
 024            .Name("setOutcome")
 025            .Parameter("name", "string")
 026            .ReturnType("void"));
 27
 028        yield return CreateFunctionDefinition(builder => builder
 029            .Name("setOutcomes")
 030            .Parameter("names", "string[]")
 031            .ReturnType("void"));
 032    }
 33}

Methods/Properties

GetFunctionDefinitions()