Skip to content

Commit fac96f3

Browse files
feat: dataraptor assessment
1 parent 72c9cc9 commit fac96f3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/utils/formula/formulaUtil.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/* eslint-disable camelcase */
22
import { expect } from '@salesforce/command/lib/test';
33
import { 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

Comments
 (0)