diff --git a/src/scripts/define_inline_functions.ts b/src/scripts/define_inline_functions.ts index 466082f..b59a0b7 100644 --- a/src/scripts/define_inline_functions.ts +++ b/src/scripts/define_inline_functions.ts @@ -16,16 +16,6 @@ export function defineInlineFunctions(options: { convertEmptyStringsToNull: bool field.isValid = false; errorReporter.report(messagesProvider.getMessage(message, rule, field, args), rule, field, args); }; -function memo(fn) { - let value; - return () => { - if (value !== undefined) { - return value - } - value = fn() - return value - } -}; function defineValue(value, field) { ${options.convertEmptyStringsToNull ? `if (value === '') { value = null; }` : ''} field.value = value; diff --git a/src/scripts/field/variables.ts b/src/scripts/field/variables.ts index 47459bd..c0b7d23 100644 --- a/src/scripts/field/variables.ts +++ b/src/scripts/field/variables.ts @@ -69,9 +69,9 @@ export function defineFieldVariables({ meta: meta, name: ${fieldNameExpression}, wildCardPath: '${wildCardPath}', - getFieldPath: memo(() => { + getFieldPath() { return ${fieldPathOutputExpression}; - }), + }, mutate: defineValue, report: report, isValid: true, diff --git a/tests/unit/nodes/array.spec.ts b/tests/unit/nodes/array.spec.ts index dad640c..e69d8c9 100644 --- a/tests/unit/nodes/array.spec.ts +++ b/tests/unit/nodes/array.spec.ts @@ -52,9 +52,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -76,9 +76,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -135,9 +135,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -159,9 +159,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -214,9 +214,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -235,9 +235,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -296,9 +296,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -317,9 +317,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -399,9 +399,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -423,9 +423,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -441,9 +441,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: 'contacts',`, ` wildCardPath: '*.contacts',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_item.getFieldPath() + '.' + 'contacts';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -461,9 +461,9 @@ test.group('Array node', () => { ` meta: meta,`, ` name: contacts_3_i,`, ` wildCardPath: '*.contacts.*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return contacts_3.getFieldPath() + '.' + contacts_3_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, diff --git a/tests/unit/nodes/literal.spec.ts b/tests/unit/nodes/literal.spec.ts index 8105994..2c70412 100644 --- a/tests/unit/nodes/literal.spec.ts +++ b/tests/unit/nodes/literal.spec.ts @@ -43,9 +43,9 @@ test.group('Literal node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -93,9 +93,9 @@ test.group('Literal node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -145,9 +145,9 @@ test.group('Literal node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, diff --git a/tests/unit/nodes/object.spec.ts b/tests/unit/nodes/object.spec.ts index 2227308..e1698fe 100644 --- a/tests/unit/nodes/object.spec.ts +++ b/tests/unit/nodes/object.spec.ts @@ -46,9 +46,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -102,9 +102,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -155,9 +155,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -221,9 +221,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -240,9 +240,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'username',`, ` wildCardPath: 'username',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'username';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -298,9 +298,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -353,9 +353,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -456,9 +456,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -475,9 +475,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'password',`, ` wildCardPath: 'password',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'password';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -494,9 +494,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'username',`, ` wildCardPath: 'username',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'username';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -514,9 +514,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'email',`, ` wildCardPath: 'email',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'email';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -657,9 +657,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -676,9 +676,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'password',`, ` wildCardPath: 'password',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'password';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -695,9 +695,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'username',`, ` wildCardPath: 'username',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'username';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -715,9 +715,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'email',`, ` wildCardPath: 'email',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'email';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -735,9 +735,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'oauth_token',`, ` wildCardPath: 'oauth_token',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'oauth_token';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -755,9 +755,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'secret_key',`, ` wildCardPath: 'secret_key',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'secret_key';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -889,9 +889,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -908,9 +908,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'password',`, ` wildCardPath: 'password',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'password';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -927,9 +927,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'username',`, ` wildCardPath: 'username',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'username';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -948,9 +948,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'hotmail',`, ` wildCardPath: 'hotmail',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'hotmail';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -968,9 +968,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'email',`, ` wildCardPath: 'email',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'email';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -1114,9 +1114,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -1133,9 +1133,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'password',`, ` wildCardPath: 'password',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'password';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -1152,9 +1152,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'username',`, ` wildCardPath: 'username',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'username';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -1172,9 +1172,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'email',`, ` wildCardPath: 'email',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'email';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -1194,9 +1194,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'oauth_token',`, ` wildCardPath: 'oauth_token',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'oauth_token';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -1214,9 +1214,9 @@ test.group('Object node', () => { ` meta: meta,`, ` name: 'secret_key',`, ` wildCardPath: 'secret_key',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'secret_key';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, diff --git a/tests/unit/nodes/record.spec.ts b/tests/unit/nodes/record.spec.ts index 6c5fa9f..027dda0 100644 --- a/tests/unit/nodes/record.spec.ts +++ b/tests/unit/nodes/record.spec.ts @@ -52,9 +52,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -78,9 +78,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -137,9 +137,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -163,9 +163,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -219,9 +219,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -242,9 +242,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -304,9 +304,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -327,9 +327,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -392,9 +392,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -415,9 +415,9 @@ test.group('Record node', () => { ` meta: meta,`, ` name: root_item_i,`, ` wildCardPath: '*',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return root_item_i;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, diff --git a/tests/unit/nodes/tuple.spec.ts b/tests/unit/nodes/tuple.spec.ts index b64c36b..65dd7f3 100644 --- a/tests/unit/nodes/tuple.spec.ts +++ b/tests/unit/nodes/tuple.spec.ts @@ -55,9 +55,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -77,9 +77,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: 0,`, ` wildCardPath: '0',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 0;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -132,9 +132,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -151,9 +151,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: 0,`, ` wildCardPath: '0',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 0;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -208,9 +208,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -227,9 +227,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: 0,`, ` wildCardPath: '0',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 0;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -284,9 +284,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -303,9 +303,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: 0,`, ` wildCardPath: '0',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 0;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -364,9 +364,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: '',`, ` wildCardPath: '',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return '';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, @@ -383,9 +383,9 @@ test.group('Tuple node', () => { ` meta: meta,`, ` name: 0,`, ` wildCardPath: '0',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 0;`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`, diff --git a/tests/unit/nodes/union.spec.ts b/tests/unit/nodes/union.spec.ts index c26aa45..292cb3d 100644 --- a/tests/unit/nodes/union.spec.ts +++ b/tests/unit/nodes/union.spec.ts @@ -71,9 +71,9 @@ test.group('Union node', () => { `meta: meta,`, `name: '',`, `wildCardPath: '',`, - `getFieldPath: memo(() => {`, + `getFieldPath() {`, ` return '';`, - `}),`, + `},`, `mutate: defineValue,`, `report: report,`, `isValid: true,`, @@ -161,9 +161,9 @@ test.group('Union node', () => { `meta: meta,`, `name: '',`, `wildCardPath: '',`, - `getFieldPath: memo(() => {`, + `getFieldPath() {`, ` return '';`, - `}),`, + `},`, `mutate: defineValue,`, `report: report,`, `isValid: true,`, diff --git a/tests/unit/scripts/field/variables.spec.ts b/tests/unit/scripts/field/variables.spec.ts index ccb13bb..ef053ba 100644 --- a/tests/unit/scripts/field/variables.spec.ts +++ b/tests/unit/scripts/field/variables.spec.ts @@ -30,9 +30,9 @@ test.group('Scripts | define field variables', () => { `meta: meta,`, `name: 'username',`, `wildCardPath: 'username',`, - `getFieldPath: memo(() => {`, + `getFieldPath() {`, ` return 'username';`, - `}),`, + `},`, `mutate: defineValue,`, `report: report,`, `isValid: true,`, @@ -65,9 +65,9 @@ test.group('Scripts | define field variables', () => { ` meta: meta,`, ` name: 'username',`, ` wildCardPath: 'username',`, - ` getFieldPath: memo(() => {`, + ` getFieldPath() {`, ` return 'username';`, - ` }),`, + ` },`, ` mutate: defineValue,`, ` report: report,`, ` isValid: true,`,