11/* eslint-disable camelcase */
22import { expect } from '@salesforce/command/lib/test' ;
33import { AnyJson } from '@salesforce/ts-types' ;
4- import { getReplacedString } from '../../../src/utils/formula/FormulaUtil' ;
4+ import { getReplacedString , populateRegexForFunctionMetadata } from '../../../src/utils/formula/FormulaUtil' ;
55
6- describe ( 'ApexASTParser ' , ( ) => {
6+ describe ( 'FormulaUtilTest ' , ( ) => {
77 it ( 'should generate new string with standard function format' , ( ) => {
88 const namespacePrefix = 'test_namespace__' ;
99 const mockedFunctionDefinitionMetadata = getMockedAllFunctionMetadata ( ) ;
10+ populateRegexForFunctionMetadata ( mockedFunctionDefinitionMetadata ) ;
1011 const inputString = "TESTMETHODFIRST('hello','bye')" ;
1112 // eslint-disable-next-line @typescript-eslint/no-unsafe-call
1213 const result = getReplacedString ( namespacePrefix , inputString , mockedFunctionDefinitionMetadata ) ;
@@ -18,6 +19,7 @@ describe('ApexASTParser', () => {
1819 it ( 'should generate new string with standard function format with nested custom formula' , ( ) => {
1920 const namespacePrefix = 'test_namespace__' ;
2021 const mockedFunctionDefinitionMetadata = getMockedAllFunctionMetadata ( ) ;
22+ populateRegexForFunctionMetadata ( mockedFunctionDefinitionMetadata ) ;
2123 const inputString = "TESTMETHODFIRST('hello',TESTMETHOD('bye'))" ;
2224 // eslint-disable-next-line @typescript-eslint/no-unsafe-call
2325 const result = getReplacedString ( namespacePrefix , inputString , mockedFunctionDefinitionMetadata ) ;
@@ -29,6 +31,7 @@ describe('ApexASTParser', () => {
2931 it ( 'should generate new string with standard function format with nested custom formula and a formula used more than Once' , ( ) => {
3032 const namespacePrefix = 'test_namespace__' ;
3133 const mockedFunctionDefinitionMetadata = getMockedAllFunctionMetadata ( ) ;
34+ populateRegexForFunctionMetadata ( mockedFunctionDefinitionMetadata ) ;
3235 const inputString = "TESTMETHODFIRST('hello',TESTMETHOD(TESTMETHODFIRST('bye','check')))" ;
3336 // eslint-disable-next-line @typescript-eslint/no-unsafe-call
3437 const result = getReplacedString ( namespacePrefix , inputString , mockedFunctionDefinitionMetadata ) ;
0 commit comments