11/* eslint-disable @typescript-eslint/no-non-null-assertion */
2- import { data , DescriptionDictionary } from "@actions/expressions" ;
2+ import { data , DescriptionDictionary , FeatureFlags } from "@actions/expressions" ;
33import { CompletionItem , CompletionItemKind , MarkupContent } from "vscode-languageserver-types" ;
44import { complete , getExpressionInput } from "./complete.js" ;
55import { ContextProviderConfig } from "./context-providers/config.js" ;
@@ -69,7 +69,8 @@ describe("expressions", () => {
6969 it ( "single region" , async ( ) => {
7070 const input = "run-name: ${{ | }}" ;
7171 const result = await complete ( ...getPositionFromCursor ( input ) , {
72- contextProviderConfig
72+ contextProviderConfig,
73+ featureFlags : new FeatureFlags ( { allowCaseFunction : true } )
7374 } ) ;
7475
7576 expect ( result . map ( x => x . label ) ) . toEqual ( [
@@ -112,7 +113,8 @@ describe("expressions", () => {
112113 it ( "single region with existing input" , async ( ) => {
113114 const input = "run-name: ${{ g| }}" ;
114115 const result = await complete ( ...getPositionFromCursor ( input ) , {
115- contextProviderConfig
116+ contextProviderConfig,
117+ featureFlags : new FeatureFlags ( { allowCaseFunction : true } )
116118 } ) ;
117119
118120 expect ( result . map ( x => x . label ) ) . toEqual ( [
@@ -133,7 +135,8 @@ describe("expressions", () => {
133135 it ( "single region with existing condition" , async ( ) => {
134136 const input = "run-name: ${{ g| == 'test' }}" ;
135137 const result = await complete ( ...getPositionFromCursor ( input ) , {
136- contextProviderConfig
138+ contextProviderConfig,
139+ featureFlags : new FeatureFlags ( { allowCaseFunction : true } )
137140 } ) ;
138141
139142 expect ( result . map ( x => x . label ) ) . toEqual ( [
@@ -154,7 +157,8 @@ describe("expressions", () => {
154157 it ( "multiple regions with partial function" , async ( ) => {
155158 const input = "run-name: Run a ${{ inputs.test }} one-line script ${{ from|('test') == inputs.name }}" ;
156159 const result = await complete ( ...getPositionFromCursor ( input ) , {
157- contextProviderConfig
160+ contextProviderConfig,
161+ featureFlags : new FeatureFlags ( { allowCaseFunction : true } )
158162 } ) ;
159163
160164 expect ( result . map ( x => x . label ) ) . toEqual ( [
@@ -175,7 +179,8 @@ describe("expressions", () => {
175179 it ( "multiple regions - first region" , async ( ) => {
176180 const input = "run-name: test-${{ git| == 1 }}-${{ github.event }}" ;
177181 const result = await complete ( ...getPositionFromCursor ( input ) , {
178- contextProviderConfig
182+ contextProviderConfig,
183+ featureFlags : new FeatureFlags ( { allowCaseFunction : true } )
179184 } ) ;
180185
181186 expect ( result . map ( x => x . label ) ) . toEqual ( [
@@ -196,7 +201,8 @@ describe("expressions", () => {
196201 it ( "multiple regions" , async ( ) => {
197202 const input = "run-name: test-${{ github }}-${{ | }}" ;
198203 const result = await complete ( ...getPositionFromCursor ( input ) , {
199- contextProviderConfig
204+ contextProviderConfig,
205+ featureFlags : new FeatureFlags ( { allowCaseFunction : true } )
200206 } ) ;
201207
202208 expect ( result . map ( x => x . label ) ) . toEqual ( [
@@ -1175,7 +1181,8 @@ jobs:
11751181` ;
11761182
11771183 const result = await complete ( ...getPositionFromCursor ( input ) , {
1178- contextProviderConfig
1184+ contextProviderConfig,
1185+ featureFlags : new FeatureFlags ( { allowCaseFunction : true } )
11791186 } ) ;
11801187 expect ( result . map ( x => x . label ) ) . toEqual ( [
11811188 "env" ,
0 commit comments