@wix/motion-edm-autogen-transformations-core 1.70.0 → 1.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/__tests__/corvid-entity.spec.js +7 -7
- package/dist/cjs/__tests__/corvid-entity.spec.js.map +1 -1
- package/dist/cjs/__tests__/getArgumentCardinality.spec.js +6 -6
- package/dist/cjs/__tests__/getArgumentCardinality.spec.js.map +1 -1
- package/dist/cjs/__tests__/helpers.spec.js +1 -1
- package/dist/cjs/__tests__/helpers.spec.js.map +1 -1
- package/dist/cjs/__tests__/reduceTransformation.spec.js +1 -1
- package/dist/cjs/__tests__/reduceTransformation.spec.js.map +1 -1
- package/dist/cjs/__tests__/transformations/custom-functions.spec.js +4 -4
- package/dist/cjs/__tests__/transformations/custom-functions.spec.js.map +1 -1
- package/dist/cjs/__tests__/transformations/preset/create-transformation.spec.js +2 -2
- package/dist/cjs/__tests__/transformations/preset/create-transformation.spec.js.map +1 -1
- package/dist/cjs/__tests__/transformations/preset/delete-transformation.spec.js +3 -3
- package/dist/cjs/__tests__/transformations/preset/delete-transformation.spec.js.map +1 -1
- package/dist/cjs/__tests__/transformations/preset/get-transformation.spec.js +2 -2
- package/dist/cjs/__tests__/transformations/preset/get-transformation.spec.js.map +1 -1
- package/dist/cjs/__tests__/transformations/preset/list-transformation.spec.js +2 -2
- package/dist/cjs/__tests__/transformations/preset/list-transformation.spec.js.map +1 -1
- package/dist/cjs/__tests__/transformations/preset/query-transformation.spec.js +2 -2
- package/dist/cjs/__tests__/transformations/preset/query-transformation.spec.js.map +1 -1
- package/dist/cjs/__tests__/transformations/preset/update-transformation.spec.js +2 -2
- package/dist/cjs/__tests__/transformations/preset/update-transformation.spec.js.map +1 -1
- package/dist/cjs/__tests__/validations/validateRequestTransformation.spec.js +2 -2
- package/dist/cjs/__tests__/validations/validateRequestTransformation.spec.js.map +1 -1
- package/dist/cjs/__tests__/validations/validateResponseTransformation.spec.js +2 -2
- package/dist/cjs/__tests__/validations/validateResponseTransformation.spec.js.map +1 -1
- package/dist/cjs/index.js +16 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/helpers.js +2 -2
- package/dist/cjs/lib/helpers.js.map +1 -1
- package/dist/cjs/lib/transformations/common.js +1 -1
- package/dist/cjs/lib/transformations/common.js.map +1 -1
- package/dist/cjs/lib/transformations/preset/create.js +1 -1
- package/dist/cjs/lib/transformations/preset/create.js.map +1 -1
- package/dist/cjs/lib/transformations/preset/delete.js +1 -1
- package/dist/cjs/lib/transformations/preset/delete.js.map +1 -1
- package/dist/cjs/lib/transformations/preset/get.js +1 -1
- package/dist/cjs/lib/transformations/preset/get.js.map +1 -1
- package/dist/cjs/lib/transformations/preset/list.js +1 -1
- package/dist/cjs/lib/transformations/preset/list.js.map +1 -1
- package/dist/cjs/lib/transformations/preset/query.js +1 -1
- package/dist/cjs/lib/transformations/preset/query.js.map +1 -1
- package/dist/cjs/lib/transformations/preset/update.js +1 -1
- package/dist/cjs/lib/transformations/preset/update.js.map +1 -1
- package/dist/cjs/lib/transformations/reduceTransformation.js +4 -4
- package/dist/cjs/lib/transformations/reduceTransformation.js.map +1 -1
- package/dist/cjs/lib/transformations/validations/common.js +1 -1
- package/dist/cjs/lib/transformations/validations/common.js.map +1 -1
- package/dist/cjs/lib/transformations/validations/validateRequestTransformation.js +6 -6
- package/dist/cjs/lib/transformations/validations/validateRequestTransformation.js.map +1 -1
- package/dist/cjs/lib/transformations/validations/validateResponseTransformation.js +8 -8
- package/dist/cjs/lib/transformations/validations/validateResponseTransformation.js.map +1 -1
- package/dist/esm/__tests__/corvid-entity.spec.js +2 -2
- package/dist/esm/__tests__/corvid-entity.spec.js.map +1 -1
- package/dist/esm/__tests__/getArgumentCardinality.spec.js +1 -1
- package/dist/esm/__tests__/getArgumentCardinality.spec.js.map +1 -1
- package/dist/esm/__tests__/helpers.spec.js +1 -1
- package/dist/esm/__tests__/helpers.spec.js.map +1 -1
- package/dist/esm/__tests__/reduceTransformation.spec.js +1 -1
- package/dist/esm/__tests__/reduceTransformation.spec.js.map +1 -1
- package/dist/esm/__tests__/transformations/custom-functions.spec.js +2 -2
- package/dist/esm/__tests__/transformations/custom-functions.spec.js.map +1 -1
- package/dist/esm/__tests__/transformations/preset/create-transformation.spec.js +1 -1
- package/dist/esm/__tests__/transformations/preset/create-transformation.spec.js.map +1 -1
- package/dist/esm/__tests__/transformations/preset/delete-transformation.spec.js +1 -1
- package/dist/esm/__tests__/transformations/preset/delete-transformation.spec.js.map +1 -1
- package/dist/esm/__tests__/transformations/preset/get-transformation.spec.js +1 -1
- package/dist/esm/__tests__/transformations/preset/get-transformation.spec.js.map +1 -1
- package/dist/esm/__tests__/transformations/preset/list-transformation.spec.js +1 -1
- package/dist/esm/__tests__/transformations/preset/list-transformation.spec.js.map +1 -1
- package/dist/esm/__tests__/transformations/preset/query-transformation.spec.js +1 -1
- package/dist/esm/__tests__/transformations/preset/query-transformation.spec.js.map +1 -1
- package/dist/esm/__tests__/transformations/preset/update-transformation.spec.js +1 -1
- package/dist/esm/__tests__/transformations/preset/update-transformation.spec.js.map +1 -1
- package/dist/esm/__tests__/validations/validateRequestTransformation.spec.js +1 -1
- package/dist/esm/__tests__/validations/validateRequestTransformation.spec.js.map +1 -1
- package/dist/esm/__tests__/validations/validateResponseTransformation.spec.js +1 -1
- package/dist/esm/__tests__/validations/validateResponseTransformation.spec.js.map +1 -1
- package/dist/esm/index.js +14 -14
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/helpers.js +2 -2
- package/dist/esm/lib/helpers.js.map +1 -1
- package/dist/esm/lib/transformations/common.js +1 -1
- package/dist/esm/lib/transformations/common.js.map +1 -1
- package/dist/esm/lib/transformations/preset/create.js +1 -1
- package/dist/esm/lib/transformations/preset/create.js.map +1 -1
- package/dist/esm/lib/transformations/preset/delete.js +1 -1
- package/dist/esm/lib/transformations/preset/delete.js.map +1 -1
- package/dist/esm/lib/transformations/preset/get.js +1 -1
- package/dist/esm/lib/transformations/preset/get.js.map +1 -1
- package/dist/esm/lib/transformations/preset/list.js +1 -1
- package/dist/esm/lib/transformations/preset/list.js.map +1 -1
- package/dist/esm/lib/transformations/preset/query.js +1 -1
- package/dist/esm/lib/transformations/preset/query.js.map +1 -1
- package/dist/esm/lib/transformations/preset/update.js +1 -1
- package/dist/esm/lib/transformations/preset/update.js.map +1 -1
- package/dist/esm/lib/transformations/reduceTransformation.js +4 -4
- package/dist/esm/lib/transformations/reduceTransformation.js.map +1 -1
- package/dist/esm/lib/transformations/validations/common.js +1 -1
- package/dist/esm/lib/transformations/validations/common.js.map +1 -1
- package/dist/esm/lib/transformations/validations/validateRequestTransformation.js +5 -5
- package/dist/esm/lib/transformations/validations/validateRequestTransformation.js.map +1 -1
- package/dist/esm/lib/transformations/validations/validateResponseTransformation.js +6 -6
- package/dist/esm/lib/transformations/validations/validateResponseTransformation.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/transformations/preset/create.d.ts +1 -1
- package/dist/types/lib/transformations/preset/create.d.ts.map +1 -1
- package/dist/types/lib/transformations/preset/get.d.ts +1 -1
- package/dist/types/lib/transformations/preset/get.d.ts.map +1 -1
- package/dist/types/lib/transformations/preset/list.d.ts +1 -1
- package/dist/types/lib/transformations/preset/list.d.ts.map +1 -1
- package/dist/types/lib/transformations/preset/update.d.ts +1 -1
- package/dist/types/lib/transformations/preset/update.d.ts.map +1 -1
- package/dist/types/lib/transformations/validations/validateRequestTransformation.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _motionRuntimeTestContext = require("@wix/motion-runtime-test-context");
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var _index = require("../index.js");
|
|
5
|
+
var _index2 = require("../lib/corvid-entity/index.js");
|
|
6
6
|
const {
|
|
7
7
|
toCorvidName,
|
|
8
8
|
fromCorvidName
|
|
9
|
-
} =
|
|
9
|
+
} = _index.corvidEntities;
|
|
10
10
|
describe('corvid entities transformers', () => {
|
|
11
11
|
describe('toCorvidName', () => {
|
|
12
12
|
test.each`
|
|
@@ -47,19 +47,19 @@ describe('corvid entities transformers', () => {
|
|
|
47
47
|
describe('isReservedCorvidFieldName', () => {
|
|
48
48
|
test('returns true if the provided name is a reserved Corvid field-name', () => {
|
|
49
49
|
const reservedCorvidName = (0, _motionRuntimeTestContext.aRandomItemFrom)(['_id', '_createdDate', '_updatedDate']);
|
|
50
|
-
expect((0,
|
|
50
|
+
expect((0, _index2.isReservedCorvidFieldName)(reservedCorvidName)).toBeTruthy();
|
|
51
51
|
});
|
|
52
52
|
test('returns false if the provided name is not a reserved common field-name', () => {
|
|
53
|
-
expect((0,
|
|
53
|
+
expect((0, _index2.isReservedCorvidFieldName)(nonReservedName)).toBeFalsy();
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
describe('isReservedCommonFieldName', () => {
|
|
57
57
|
test('returns true if the provided name is a reserved common field-name', () => {
|
|
58
58
|
const commonReservedName = (0, _motionRuntimeTestContext.aRandomItemFrom)(['id', 'createdDate', 'updatedDate']);
|
|
59
|
-
expect((0,
|
|
59
|
+
expect((0, _index2.isReservedCommonFieldName)(commonReservedName)).toBeTruthy();
|
|
60
60
|
});
|
|
61
61
|
test('returns false if the provided name is not a reserved common field-name', () => {
|
|
62
|
-
expect((0,
|
|
62
|
+
expect((0, _index2.isReservedCommonFieldName)(nonReservedName)).toBeFalsy();
|
|
63
63
|
});
|
|
64
64
|
});
|
|
65
65
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_motionRuntimeTestContext","require","
|
|
1
|
+
{"version":3,"names":["_motionRuntimeTestContext","require","_index","_index2","toCorvidName","fromCorvidName","corvidEntities","describe","test","each","name","expected","expect","toStrictEqual","aString","nonReservedName","reservedCorvidName","aRandomItemFrom","isReservedCorvidFieldName","toBeTruthy","toBeFalsy","commonReservedName","isReservedCommonFieldName"],"sources":["../../../src/__tests__/corvid-entity.spec.ts"],"sourcesContent":["import { aRandomItemFrom, aString } from '@wix/motion-runtime-test-context';\n\nimport { corvidEntities } from '../index.js';\nimport {\n isReservedCommonFieldName,\n isReservedCorvidFieldName,\n} from '../lib/corvid-entity/index.js';\n\nconst { toCorvidName, fromCorvidName } = corvidEntities;\n\ndescribe('corvid entities transformers', () => {\n describe('toCorvidName', () => {\n test.each`\n name | expected\n ${'id'} | ${'_id'}\n ${'createdDate'} | ${'_createdDate'}\n ${'updatedDate'} | ${'_updatedDate'}\n `('adjusts $name to $expected', ({ name, expected }) => {\n expect(toCorvidName(name)).toStrictEqual(expected);\n });\n\n test('returns the given name when it should not be changed', () => {\n const name = aString();\n\n expect(toCorvidName(name)).toStrictEqual(name);\n });\n });\n\n describe('fromCorvidName', () => {\n test.each`\n name | expected\n ${'_id'} | ${'id'}\n ${'_createdDate'} | ${'createdDate'}\n ${'_updatedDate'} | ${'updatedDate'}\n `('adjusts $name to $expected', ({ name, expected }) => {\n expect(fromCorvidName(name)).toStrictEqual(expected);\n });\n\n test('returns the given name when it should not be changed', () => {\n const name = aString();\n\n expect(fromCorvidName(name)).toStrictEqual(name);\n });\n });\n\n describe('internal methods', () => {\n const nonReservedName = aString();\n\n describe('isReservedCorvidFieldName', () => {\n test('returns true if the provided name is a reserved Corvid field-name', () => {\n const reservedCorvidName = aRandomItemFrom([\n '_id',\n '_createdDate',\n '_updatedDate',\n ]);\n\n expect(isReservedCorvidFieldName(reservedCorvidName)).toBeTruthy();\n });\n\n test('returns false if the provided name is not a reserved common field-name', () => {\n expect(isReservedCorvidFieldName(nonReservedName)).toBeFalsy();\n });\n });\n\n describe('isReservedCommonFieldName', () => {\n test('returns true if the provided name is a reserved common field-name', () => {\n const commonReservedName = aRandomItemFrom([\n 'id',\n 'createdDate',\n 'updatedDate',\n ]);\n\n expect(isReservedCommonFieldName(commonReservedName)).toBeTruthy();\n });\n\n test('returns false if the provided name is not a reserved common field-name', () => {\n expect(isReservedCommonFieldName(nonReservedName)).toBeFalsy();\n });\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,MAAM;EAAEG,YAAY;EAAEC;AAAe,CAAC,GAAGC,qBAAc;AAEvDC,QAAQ,CAAC,8BAA8B,EAAE,MAAM;EAC7CA,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC7BC,IAAI,CAACC,IAAI;AACb;AACA,QAAQ,IAAI,eAAe,KAAK;AAChC,QAAQ,aAAa,MAAM,cAAc;AACzC,QAAQ,aAAa,MAAM,cAAc;AACzC,KAAK,CAAC,4BAA4B,EAAE,CAAC;MAAEC,IAAI;MAAEC;IAAS,CAAC,KAAK;MACtDC,MAAM,CAACR,YAAY,CAACM,IAAI,CAAC,CAAC,CAACG,aAAa,CAACF,QAAQ,CAAC;IACpD,CAAC,CAAC;IAEFH,IAAI,CAAC,sDAAsD,EAAE,MAAM;MACjE,MAAME,IAAI,GAAG,IAAAI,iCAAO,EAAC,CAAC;MAEtBF,MAAM,CAACR,YAAY,CAACM,IAAI,CAAC,CAAC,CAACG,aAAa,CAACH,IAAI,CAAC;IAChD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFH,QAAQ,CAAC,gBAAgB,EAAE,MAAM;IAC/BC,IAAI,CAACC,IAAI;AACb;AACA,QAAQ,KAAK,eAAe,IAAI;AAChC,QAAQ,cAAc,MAAM,aAAa;AACzC,QAAQ,cAAc,MAAM,aAAa;AACzC,KAAK,CAAC,4BAA4B,EAAE,CAAC;MAAEC,IAAI;MAAEC;IAAS,CAAC,KAAK;MACtDC,MAAM,CAACP,cAAc,CAACK,IAAI,CAAC,CAAC,CAACG,aAAa,CAACF,QAAQ,CAAC;IACtD,CAAC,CAAC;IAEFH,IAAI,CAAC,sDAAs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
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _motionRuntimeTestContext = require("@wix/motion-runtime-test-context");
|
|
4
|
-
var
|
|
4
|
+
var _index = require("../index.js");
|
|
5
5
|
describe('getArgumentCardinality', () => {
|
|
6
6
|
describe('simple transformation', () => {
|
|
7
7
|
const simpleTransformation = `$[${(0, _motionRuntimeTestContext.aNumber)({
|
|
8
8
|
min: 0,
|
|
9
9
|
max: 9
|
|
10
10
|
})}].${(0, _motionRuntimeTestContext.aString)()}`;
|
|
11
|
-
expect((0,
|
|
11
|
+
expect((0, _index.getArgumentCardinality)(simpleTransformation)).toStrictEqual(1);
|
|
12
12
|
});
|
|
13
13
|
describe('complex transformations', () => {
|
|
14
14
|
const nonArgumentMapping = (0, _motionRuntimeTestContext.anObject)();
|
|
@@ -25,14 +25,14 @@ describe('getArgumentCardinality', () => {
|
|
|
25
25
|
...nonArgumentMapping,
|
|
26
26
|
...argumentMapping
|
|
27
27
|
};
|
|
28
|
-
expect((0,
|
|
28
|
+
expect((0, _index.getArgumentCardinality)(complexMappingTransformation)).toStrictEqual(4);
|
|
29
29
|
});
|
|
30
30
|
test('counts the number of arguments referenced in a transformation object with arrays', () => {
|
|
31
31
|
const complexMappingTransformation = {
|
|
32
32
|
...nonArgumentMapping,
|
|
33
33
|
[(0, _motionRuntimeTestContext.aString)()]: argumentMappingArray
|
|
34
34
|
};
|
|
35
|
-
expect((0,
|
|
35
|
+
expect((0, _index.getArgumentCardinality)(complexMappingTransformation)).toStrictEqual(2);
|
|
36
36
|
});
|
|
37
37
|
test('counts only unique occurrences', () => {
|
|
38
38
|
const complexMappingTransformation = {
|
|
@@ -40,7 +40,7 @@ describe('getArgumentCardinality', () => {
|
|
|
40
40
|
...argumentMapping,
|
|
41
41
|
[(0, _motionRuntimeTestContext.aString)()]: argumentMappingArray
|
|
42
42
|
};
|
|
43
|
-
expect((0,
|
|
43
|
+
expect((0, _index.getArgumentCardinality)(complexMappingTransformation)).toStrictEqual(4);
|
|
44
44
|
});
|
|
45
45
|
test('does not fail on special transformation cases', () => {
|
|
46
46
|
const specialTransformation = {
|
|
@@ -52,7 +52,7 @@ describe('getArgumentCardinality', () => {
|
|
|
52
52
|
},
|
|
53
53
|
[(0, _motionRuntimeTestContext.aString)()]: '$[0].a.b.c.'
|
|
54
54
|
};
|
|
55
|
-
expect((0,
|
|
55
|
+
expect((0, _index.getArgumentCardinality)(specialTransformation)).toStrictEqual(1);
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_motionRuntimeTestContext","require","
|
|
1
|
+
{"version":3,"names":["_motionRuntimeTestContext","require","_index","describe","simpleTransformation","aNumber","min","max","aString","expect","getArgumentCardinality","toStrictEqual","nonArgumentMapping","anObject","argumentMapping","argumentMappingArray","test","complexMappingTransformation","specialTransformation"],"sources":["../../../src/__tests__/getArgumentCardinality.spec.ts"],"sourcesContent":["import { anObject, aNumber, aString } from '@wix/motion-runtime-test-context';\n\nimport { getArgumentCardinality } from '../index.js';\n\ndescribe('getArgumentCardinality', () => {\n describe('simple transformation', () => {\n const simpleTransformation = `$[${aNumber({\n min: 0,\n max: 9,\n })}].${aString()}`;\n\n expect(getArgumentCardinality(simpleTransformation)).toStrictEqual(1);\n });\n\n describe('complex transformations', () => {\n const nonArgumentMapping = anObject();\n\n const argumentMapping = {\n [aString()]: '$[0].abc',\n [aString()]: '$[1].id',\n [aString()]: '$[2].a',\n [aString()]: '$[3].a.b.c',\n ...nonArgumentMapping,\n };\n\n const argumentMappingArray = ['$[0].a', '$[1].b', 'a.b.c'];\n\n test('counts the number of arguments referenced in a given transformation object', () => {\n const complexMappingTransformation = {\n ...nonArgumentMapping,\n ...argumentMapping,\n };\n\n expect(\n getArgumentCardinality(complexMappingTransformation),\n ).toStrictEqual(4);\n });\n\n test('counts the number of arguments referenced in a transformation object with arrays', () => {\n const complexMappingTransformation = {\n ...nonArgumentMapping,\n [aString()]: argumentMappingArray,\n };\n\n expect(\n getArgumentCardinality(complexMappingTransformation),\n ).toStrictEqual(2);\n });\n\n test('counts only unique occurrences', () => {\n const complexMappingTransformation = {\n ...nonArgumentMapping,\n ...argumentMapping,\n [aString()]: argumentMappingArray,\n };\n\n expect(\n getArgumentCardinality(complexMappingTransformation),\n ).toStrictEqual(4);\n });\n\n test('does not fail on special transformation cases', () => {\n const specialTransformation = {\n [aString()]: { '@constant': true },\n [aString()]: { '@constant': null },\n [aString()]: '$[0].a.b.c.',\n };\n\n expect(getArgumentCardinality(specialTransformation)).toStrictEqual(1);\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEAE,QAAQ,CAAC,wBAAwB,EAAE,MAAM;EACvCA,QAAQ,CAAC,uBAAuB,EAAE,MAAM;IACtC,MAAMC,oBAAoB,GAAG,KAAK,IAAAC,iCAAO,EAAC;MACxCC,GAAG,EAAE,CAAC;MACNC,GAAG,EAAE;IACP,CAAC,CAAC,KAAK,IAAAC,iCAAO,EAAC,CAAC,EAAE;IAElBC,MAAM,CAAC,IAAAC,6BAAsB,EAACN,oBAAoB,CAAC,CAAC,CAACO,aAAa,CAAC,CAAC,CAAC;EACvE,CAAC,CAAC;EAEFR,QAAQ,CAAC,yBAAyB,EAAE,MAAM;IACxC,MAAMS,kBAAkB,GAAG,IAAAC,kCAAQ,EAAC,CAAC;IAErC,MAAMC,eAAe,GAAG;MACtB,CAAC,IAAAN,iCAAO,EAAC,CAAC,GAAG,UAAU;MACvB,CAAC,IAAAA,iCAAO,EAAC,CAAC,GAAG,SAAS;MACtB,CAAC,IAAAA,iCAAO,EAAC,CAAC,GAAG,QAAQ;MACrB,CAAC,IAAAA,iCAAO,EAAC,CAAC,GAAG,YAAY;MACzB,GAAGI;IACL,CAAC;IAED,MAAMG,oBAAoB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC;IAE1DC,IAAI,CA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@wix/motion-edm-autogen-test-context");
|
|
4
4
|
var _motionRuntimeTestContext = require("@wix/motion-runtime-test-context");
|
|
5
5
|
var _lodash = require("lodash");
|
|
6
|
-
var _helpers = require("../lib/helpers");
|
|
6
|
+
var _helpers = require("../lib/helpers.js");
|
|
7
7
|
describe('helper functions', () => {
|
|
8
8
|
const index = (0, _motionRuntimeTestContext.aNumber)({
|
|
9
9
|
min: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_motionEdmAutogenTestContext","require","_motionRuntimeTestContext","_lodash","_helpers","describe","index","aNumber","min","max","nestedPath","times","aString","join","simpleTransformation","simpleTransformationWithNestedPath","test","each","aSimpleMappingTransformation","simpleMapping","aComplexMappingTransformation","complexMapping","transformation","expectedValue","expect","isSimpleTransformation","toStrictEqual","extractIndexAndPath","getArgumentIndex","toBeNull","aRandomJsonPath","expression","expectedResult","isJsonPathExpression","nonJsonPathString","jsonPath","aRandomResponseTransformationJsonPath","slice","stripJsonPathRootPrefix","isInvalidJsonValue","toBeTruthy","toBeFalsy"],"sources":["../../../src/__tests__/helpers.spec.ts"],"sourcesContent":["import {\n aComplexMappingTransformation,\n aRandomJsonPath,\n aRandomResponseTransformationJsonPath,\n aSimpleMappingTransformation,\n} from '@wix/motion-edm-autogen-test-context';\nimport { aNumber, aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport {\n extractIndexAndPath,\n getArgumentIndex,\n isInvalidJsonValue,\n isJsonPathExpression,\n isSimpleTransformation,\n stripJsonPathRootPrefix,\n} from '../lib/helpers';\n\ndescribe('helper functions', () => {\n const index = aNumber({ min: 0, max: 1 });\n // @ts-expect-error\n const nestedPath = times(3, aString()).join('.');\n const simpleTransformation = `$[${index}]`;\n const simpleTransformationWithNestedPath = `$[${index}].${nestedPath}`;\n\n describe('isSimpleTransformation', () => {\n test.each`\n transformation | expectedValue | transformationType\n ${aSimpleMappingTransformation().simpleMapping} | ${true} | ${'simple'}\n ${aComplexMappingTransformation().complexMapping} | ${false} | ${'complex'}\n `(\n 'returns $expectedValue for $transformationType transformation',\n ({ transformation, expectedValue }) => {\n expect(isSimpleTransformation(transformation)).toStrictEqual(\n expectedValue,\n );\n },\n );\n });\n\n describe('extractIndexAndPath', () => {\n test('extracts the index and nested-path of the argument from a simple tranformation', () => {\n expect(\n extractIndexAndPath(simpleTransformationWithNestedPath),\n ).toStrictEqual({ index, nestedPath });\n });\n\n test('sets the nestedPath to null when one could not be found', () => {\n expect(extractIndexAndPath(simpleTransformation)).toStrictEqual({\n index,\n nestedPath: null,\n });\n });\n });\n\n describe('getArgumentIndex', () => {\n test('extracts the index of an argument within a jsonpath', () => {\n expect(getArgumentIndex(simpleTransformation)).toStrictEqual(index);\n });\n\n test('return null when no index was found', () => {\n expect(getArgumentIndex(aString())).toBeNull();\n });\n });\n\n describe('isJsonPathExpression', () => {\n test.each`\n description | expression | expectedResult\n ${'starts with $'} | ${aRandomJsonPath()} | ${true}\n ${'does not start with $'} | ${aString()} | ${false}\n `(\n 'return $expectedResult when the expression $description',\n ({ expression, expectedResult }) => {\n expect(isJsonPathExpression(expression)).toStrictEqual(expectedResult);\n },\n );\n });\n\n describe('stripJsonPathRootPrefix', () => {\n const nonJsonPathString = aString();\n const jsonPath = aRandomResponseTransformationJsonPath();\n\n test.each`\n description | expression | expectedResult\n ${'is $'} | ${'$'} | ${'$'}\n ${'does not start with $'} | ${nonJsonPathString} | ${nonJsonPathString}\n ${'starts with $.'} | ${jsonPath} | ${jsonPath.slice(2)}\n `(\n 'return $expectedResult when the expression $description',\n ({ expression, expectedResult }) => {\n expect(stripJsonPathRootPrefix(expression)).toStrictEqual(\n expectedResult,\n );\n },\n );\n });\n\n describe('isInvalidJsonValue', () => {\n test('returns true for an invalid json-value', () => {\n expect(isInvalidJsonValue('x-y-z')).toBeTruthy();\n });\n\n test('returns false for a valid json-value', () => {\n expect(isInvalidJsonValue('\"string\"')).toBeFalsy();\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA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A,QAAQ,CAACE,KAAK,CAAC,CAAC,CAAC;AAC7E,KAAK,CACC,yDAAyD,EACzD,CAAC;MAAEN,UAAU;MAAEC;IAAe,CAAC,KAAK;MAClCR,MAAM,CAAC,IAAAc,gCAAuB,EAACP,UAAU,CAAC,CAAC,CAACL,aAAa,CACvDM,cACF,CAAC;IACH,CACF,CAAC;EACH,CAAC,CAAC;EAEF3B,QAAQ,CAAC,oBAAoB,EAAE,MAAM;IACnCW,IAAI,CAAC,wCAAwC,EAAE,MAAM;MACnDQ,MAAM,CAAC,IAAAe,2BAAkB,EAAC,OAAO,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IAClD,CAAC,CAAC;IAEFxB,IAAI,CAAC,sCAAsC,EAAE,MAAM;MACjDQ,MAAM,CAAC,IAAAe,2BAAkB,EAAC,UAAU,CAAC,CAAC,CAACE,SAAS,CAAC,CAAC;IACpD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_motionEdmAutogenTestContext","require","_motionRuntimeTestContext","_lodash","_helpers","describe","index","aNumber","min","max","nestedPath","times","aString","join","simpleTransformation","simpleTransformationWithNestedPath","test","each","aSimpleMappingTransformation","simpleMapping","aComplexMappingTransformation","complexMapping","transformation","expectedValue","expect","isSimpleTransformation","toStrictEqual","extractIndexAndPath","getArgumentIndex","toBeNull","aRandomJsonPath","expression","expectedResult","isJsonPathExpression","nonJsonPathString","jsonPath","aRandomResponseTransformationJsonPath","slice","stripJsonPathRootPrefix","isInvalidJsonValue","toBeTruthy","toBeFalsy"],"sources":["../../../src/__tests__/helpers.spec.ts"],"sourcesContent":["import {\n aComplexMappingTransformation,\n aRandomJsonPath,\n aRandomResponseTransformationJsonPath,\n aSimpleMappingTransformation,\n} from '@wix/motion-edm-autogen-test-context';\nimport { aNumber, aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport {\n extractIndexAndPath,\n getArgumentIndex,\n isInvalidJsonValue,\n isJsonPathExpression,\n isSimpleTransformation,\n stripJsonPathRootPrefix,\n} from '../lib/helpers.js';\n\ndescribe('helper functions', () => {\n const index = aNumber({ min: 0, max: 1 });\n // @ts-expect-error\n const nestedPath = times(3, aString()).join('.');\n const simpleTransformation = `$[${index}]`;\n const simpleTransformationWithNestedPath = `$[${index}].${nestedPath}`;\n\n describe('isSimpleTransformation', () => {\n test.each`\n transformation | expectedValue | transformationType\n ${aSimpleMappingTransformation().simpleMapping} | ${true} | ${'simple'}\n ${aComplexMappingTransformation().complexMapping} | ${false} | ${'complex'}\n `(\n 'returns $expectedValue for $transformationType transformation',\n ({ transformation, expectedValue }) => {\n expect(isSimpleTransformation(transformation)).toStrictEqual(\n expectedValue,\n );\n },\n );\n });\n\n describe('extractIndexAndPath', () => {\n test('extracts the index and nested-path of the argument from a simple tranformation', () => {\n expect(\n extractIndexAndPath(simpleTransformationWithNestedPath),\n ).toStrictEqual({ index, nestedPath });\n });\n\n test('sets the nestedPath to null when one could not be found', () => {\n expect(extractIndexAndPath(simpleTransformation)).toStrictEqual({\n index,\n nestedPath: null,\n });\n });\n });\n\n describe('getArgumentIndex', () => {\n test('extracts the index of an argument within a jsonpath', () => {\n expect(getArgumentIndex(simpleTransformation)).toStrictEqual(index);\n });\n\n test('return null when no index was found', () => {\n expect(getArgumentIndex(aString())).toBeNull();\n });\n });\n\n describe('isJsonPathExpression', () => {\n test.each`\n description | expression | expectedResult\n ${'starts with $'} | ${aRandomJsonPath()} | ${true}\n ${'does not start with $'} | ${aString()} | ${false}\n `(\n 'return $expectedResult when the expression $description',\n ({ expression, expectedResult }) => {\n expect(isJsonPathExpression(expression)).toStrictEqual(expectedResult);\n },\n );\n });\n\n describe('stripJsonPathRootPrefix', () => {\n const nonJsonPathString = aString();\n const jsonPath = aRandomResponseTransformationJsonPath();\n\n test.each`\n description | expression | expectedResult\n ${'is $'} | ${'$'} | ${'$'}\n ${'does not start with $'} | ${nonJsonPathString} | ${nonJsonPathString}\n ${'starts with $.'} | ${jsonPath} | ${jsonPath.slice(2)}\n `(\n 'return $expectedResult when the expression $description',\n ({ expression, expectedResult }) => {\n expect(stripJsonPathRootPrefix(expression)).toStrictEqual(\n expectedResult,\n );\n },\n );\n });\n\n describe('isInvalidJsonValue', () => {\n test('returns true for an invalid json-value', () => {\n expect(isInvalidJsonValue('x-y-z')).toBeTruthy();\n });\n\n test('returns false for a valid json-value', () => {\n expect(isInvalidJsonValue('\"string\"')).toBeFalsy();\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AAMA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AASAI,QAAQ,CAAC,kBAAkB,EAAE,MAAM;EACjC,MAAMC,KAAK,GAAG,IAAAC,iCAAO,EAAC;IAAEC,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE;EAAE,CAAC,CAAC;EACzC;EACA,MAAMC,UAAU,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAE,IAAAC,iCAAO,EAAC,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAChD,MAAMC,oBAAoB,GAAG,KAAKR,KAAK,GAAG;EAC1C,MAAMS,kCAAkC,GAAG,KAAKT,KAAK,KAAKI,UAAU,EAAE;EAEtEL,QAAQ,CAAC,wBAAwB,EAAE,MAAM;IACvCW,IAAI,CAACC,IAAI;AACb;AACA,QAAQ,IAAAC,yDAA4B,EAAC,CAAC,CAACC,aAAa,QAAQ,IAAI,YAAY,QAAQ;AACpF,QAAQ,IAAAC,0DAA6B,EAAC,CAAC,CAACC,cAAc,MAAM,KAAK,WAAW,SAAS;AACrF,KAAK,CACC,+DAA+D,EAC/D,CAAC;MAAEC,cAAc;MAAEC;IAAc,CAAC,KAAK;MACrCC,MAAM,CAAC,IAAAC,+BAAsB,EAACH,cAAc,CAAC,CAAC,CAACI,aAAa,CAC1DH,aACF,CAAC;I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,CAAC;EAEF3B,QAAQ,CAAC,yBAAyB,EAAE,MAAM;IACxC,MAAM6B,iBAAiB,GAAG,IAAAtB,iCAAO,EAAC,CAAC;IACnC,MAAMuB,QAAQ,GAAG,IAAAC,kEAAqC,EAAC,CAAC;IAExDpB,IAAI,CAACC,IAAI;AACb;AACA,QAAQ,MAAM,uBAAuB,GAAG,oBAAoB,GAAG;AAC/D,QAAQ,uBAAuB,MAAMiB,iBAAiB,MAAMA,iBAAiB;AAC7E,QAAQ,gBAAgB,aAAaC,QAAQ,eAAeA,QAAQ,CAACE,KAAK,CAAC,CAAC,CAAC;AAC7E,KAAK,CACC,yDAAyD,EACzD,CAAC;MAAEN,UAAU;MAAEC;IAAe,CAAC,KAAK;MAClCR,MAAM,CAAC,IAAAc,gCAAuB,EAACP,UAAU,CAAC,CAAC,CAACL,aAAa,CACvDM,cACF,CAAC;IACH,CACF,CAAC;EACH,CAAC,CAAC;EAEF3B,QAAQ,CAAC,oBAAoB,EAAE,MAAM;IACnCW,IAAI,CAAC,wCAAwC,EAAE,MAAM;MACnDQ,MAAM,CAAC,IAAAe,2BAAkB,EAAC,OAAO,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IAClD,CAAC,CAAC;IAEFxB,IAAI,CAAC,sCAAsC,EAAE,MAAM;MACjDQ,MAAM,CAAC,IAAAe,2BAAkB,EAAC,UAAU,CAAC,CAAC,CAACE,SAAS,CAAC,CAAC;IACpD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _motionRuntimeTestContext = require("@wix/motion-runtime-test-context");
|
|
4
4
|
var _lodash = require("lodash");
|
|
5
|
-
var _reduceTransformation = require("../lib/transformations/reduceTransformation");
|
|
5
|
+
var _reduceTransformation = require("../lib/transformations/reduceTransformation.js");
|
|
6
6
|
describe('reduceTransformation', () => {
|
|
7
7
|
describe('simple transformations', () => {
|
|
8
8
|
const visitorCallbackResult = (0, _motionRuntimeTestContext.aString)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_reduceTransformation","describe","visitorCallbackResult","aString","test","visitorCallback","jest","fn","mockReturnValueOnce","transformation","result","reduceTransformation","visitors","TopLevelSimpleTransformationExpression","expect","toHaveBeenCalledTimes","toHaveBeenCalledWith","toStrictEqual","TopLevelCustomFunctionExpression","transformationWithInvalidCustomFunctionExpression","TopLevelUnsupportedTransformationExpression","accumulator","anObject","a","b","c","d","e","NestedSimpleTransformationExpression","topLevelSpreadOperatorCallback","nestedSpreadOperatorCallback","times","argumentExpression","sibling","siblingKeys","Object","keys","path","beforeEach","forEach","mock","mockClear","nestedOmitCallback","omitExpression","TopLevelSpreadExpression","NestedOmit","NestedSpreadExpression","not","toHaveBeenCalled","set","simpleTransformationCallback","anotherArgumentExpression","topLevelArgumentExpression","customFunctionExpressionCallback","customFunctionExpression","CustomFunctionExpression","invalidCustomFunctionExpression","nestedConstantExpressionCallback","undesiredVisitor","someConst","NestedConstantValue","value","countAccumulator","count","unsupportedTransformationValue","NestedUnsupportedTransformationExpression","TopLevelMapArrayItems","withItemTransformation","itemTransformation","MapArrayItems","nestedSimpleTransformationVisitor","yyy","zzz","fieldsToOmit","sourcePathExpression","TopLevelOmit","each","visitorType","errorMessage","error","Error","mockImplementationOnce","toThrow"],"sources":["../../../src/__tests__/reduceTransformation.spec.ts"],"sourcesContent":["import { anObject, aString } from '@wix/motion-runtime-test-context';\nimport { set, times } from 'lodash';\n\nimport { reduceTransformation } from '../lib/transformations/reduceTransformation';\n\ndescribe('reduceTransformation', () => {\n describe('simple transformations', () => {\n const visitorCallbackResult = aString();\n\n test('traverses a simple transformation', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformation = '$.a.b.c';\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelSimpleTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith('$.a.b.c');\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n\n describe('custom-functions', () => {\n test('traverses a valid custom-function expression', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformation = '#someCustomFunction($.a.b.c,someOtherArg)';\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelCustomFunctionExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n 'someCustomFunction',\n ['$.a.b.c', 'someOtherArg'],\n transformation,\n );\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n\n test('does not fail for invalid custom-function expression', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformationWithInvalidCustomFunctionExpression = '#($.a.b.c)';\n\n const result = reduceTransformation(\n transformationWithInvalidCustomFunctionExpression,\n {\n visitors: {\n TopLevelCustomFunctionExpression: visitorCallback,\n },\n },\n );\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n null,\n null,\n transformationWithInvalidCustomFunctionExpression,\n );\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n });\n\n // TODO: replace with returning the invalid value, for constant-transformation\n test('invokes the TopLevelUnsupportedTransformationExpression otherwise', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n\n const transformation = aString();\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelUnsupportedTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(transformation);\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n });\n\n describe('complex transformation', () => {\n const accumulator = anObject();\n\n test('traverses all string nodes that are transformation expressions', () => {\n const visitorCallback = jest.fn();\n\n const transformation = {\n a: {\n b: { c: '$[0].ddd.eee.ffff' },\n d: 2,\n e: ['$.ggg', 3, 4, 5],\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSimpleTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(2);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b.c',\n '$[0].ddd.eee.ffff',\n );\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.e[0]',\n '$.ggg',\n );\n });\n\n describe('spread operator', () => {\n const [topLevelSpreadOperatorCallback, nestedSpreadOperatorCallback] =\n times(2, () => jest.fn());\n const argumentExpression = '$[1].d.e.f';\n const sibling = anObject();\n const siblingKeys = Object.keys(sibling);\n const path = `${siblingKeys[0]}.b.c`;\n\n beforeEach(() => {\n [topLevelSpreadOperatorCallback, nestedSpreadOperatorCallback].forEach(\n (mock) => mock.mockClear(),\n );\n });\n\n test('invokes the spread operator visitor prior to its children', () => {\n const nestedOmitCallback = jest.fn();\n const omitExpression = {\n '@source': argumentExpression,\n '@omit': times(2, () => aString()),\n };\n const transformation = { '*': omitExpression, ...sibling };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedOmit: nestedOmitCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n omitExpression,\n siblingKeys,\n );\n\n // expect(nestedOmitCallback).toHaveBeenCalled();\n });\n\n test('traverses top-level spread-operator transformation nodes', () => {\n const transformation = { '*': argumentExpression, ...sibling };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n argumentExpression,\n siblingKeys,\n );\n expect(nestedSpreadOperatorCallback).not.toHaveBeenCalled();\n });\n\n test('traverses nested spread-operator transformation nodes', () => {\n const transformation = set({}, path, {\n '*': argumentExpression,\n ...sibling,\n });\n const simpleTransformationCallback = jest.fn();\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).not.toHaveBeenCalled();\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n argumentExpression,\n siblingKeys,\n );\n });\n\n test('traverses items within an array of a spread-operator transformation nodes', () => {\n const simpleTransformationCallback = jest.fn();\n const transformation = set({}, path, {\n '*': ['$[0].x.y.z', '$[1].d.e.f'],\n ...sibling,\n });\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(2);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$[0].x.y.z',\n siblingKeys,\n );\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$[1].d.e.f',\n siblingKeys,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n\n test('sets the path to be the parent of the spread operator', () => {\n const anotherArgumentExpression = '$[0].x.y.z';\n const topLevelArgumentExpression = '$[1]';\n const transformation = set(\n { '*': topLevelArgumentExpression, ...sibling },\n path,\n {\n '*': [anotherArgumentExpression, argumentExpression],\n },\n );\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n },\n });\n\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(2);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n argumentExpression,\n [],\n );\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n anotherArgumentExpression,\n [],\n );\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n topLevelArgumentExpression,\n siblingKeys,\n );\n });\n });\n\n describe('custom functions', () => {\n test('traverses custom-function nodes', () => {\n const customFunctionExpressionCallback = jest.fn();\n const simpleTransformationCallback = jest.fn();\n const customFunctionExpression =\n '#someCustomFunction($[0].someCustomFunction)';\n const transformation = {\n a: {\n b: customFunctionExpression,\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n CustomFunctionExpression: customFunctionExpressionCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(customFunctionExpressionCallback).toHaveBeenCalledTimes(1);\n expect(customFunctionExpressionCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b',\n 'someCustomFunction',\n ['$[0].someCustomFunction'],\n customFunctionExpression,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n\n test('does not fail on invalid custom-function nodes', () => {\n const customFunctionExpressionCallback = jest.fn();\n const simpleTransformationCallback = jest.fn();\n const invalidCustomFunctionExpression = '#($[0].someCustomFunction)';\n\n const transformation = {\n a: {\n b: invalidCustomFunctionExpression,\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n CustomFunctionExpression: customFunctionExpressionCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(customFunctionExpressionCallback).toHaveBeenCalledTimes(1);\n expect(customFunctionExpressionCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b',\n null,\n null,\n invalidCustomFunctionExpression,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n });\n\n describe('constant annotation', () => {\n test('traverses a nested constant annotation expression', () => {\n const nestedConstantExpressionCallback = jest.fn();\n const undesiredVisitor = jest.fn();\n const transformation = {\n a: { b: { c: { '@constant': { someConst: '$.value123' } } } },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedConstantValue: nestedConstantExpressionCallback,\n NestedSimpleTransformationExpression: undesiredVisitor,\n },\n });\n\n expect(nestedConstantExpressionCallback).toHaveBeenCalledTimes(1);\n expect(nestedConstantExpressionCallback).toHaveBeenCalledWith({\n accumulator,\n path: 'a.b.c',\n value: { someConst: '$.value123' },\n });\n expect(undesiredVisitor).not.toHaveBeenCalled();\n });\n });\n\n test('returns the accumulator with changes made to it', () => {\n const countAccumulator = { count: 0 };\n\n const transformation = {\n a: {\n b: 1,\n '*': '$[0].a.b.c',\n },\n };\n\n const result = reduceTransformation(transformation, {\n accumulator: countAccumulator,\n visitors: {\n NestedSpreadExpression: () => {\n countAccumulator.count += 1;\n },\n },\n });\n\n expect(result).toStrictEqual({ count: 1 });\n });\n\n // TODO: replace with returning the invalid value, for constant-transformation\n test('invokes the NestedUnsupportedTransformationExpression otherwise', () => {\n const visitorCallback = jest.fn();\n const unsupportedTransformationValue = aString();\n const transformation = {\n a: { b: { c: unsupportedTransformationValue } },\n };\n\n reduceTransformation(transformation, {\n visitors: {\n NestedUnsupportedTransformationExpression: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b.c',\n unsupportedTransformationValue,\n );\n });\n });\n\n describe('mapping array items', () => {\n const visitorCallback = jest.fn();\n\n beforeEach(() => {\n visitorCallback.mockClear();\n });\n\n describe('top-level transformation', () => {\n test('invokes the TopLevelMapArrayItems visitor', () => {\n const transformation = {\n '@path': '$.d.e.f',\n '@itemTransformation': '$.g.h.i',\n };\n\n reduceTransformation(transformation, {\n visitors: {\n TopLevelMapArrayItems: visitorCallback,\n },\n accumulator: {},\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith('$.d.e.f', '$.g.h.i');\n });\n });\n\n describe('nested transformation', () => {\n const accumulator = {};\n const path = 'a.b.c';\n\n const withItemTransformation = (itemTransformation) =>\n set({}, path, {\n '@path': '$.d.e.f',\n '@itemTransformation': itemTransformation,\n });\n\n describe('simple item-transformation', () => {\n test('invokes the MapArrayItems visitor', () => {\n reduceTransformation(withItemTransformation('$.g.h.i'), {\n visitors: {\n MapArrayItems: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$.d.e.f',\n '$.g.h.i',\n );\n });\n });\n\n describe('complex item-transformation', () => {\n test('invokes the MapArrayItems visitor', () => {\n const nestedSimpleTransformationVisitor = jest.fn();\n\n reduceTransformation(\n withItemTransformation({ yyy: '$.g.h.i', zzz: '$.j.k.l' }),\n {\n visitors: {\n MapArrayItems: visitorCallback,\n NestedSimpleTransformationExpression:\n nestedSimpleTransformationVisitor,\n },\n accumulator,\n },\n );\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$.d.e.f',\n {\n yyy: '$.g.h.i',\n zzz: '$.j.k.l',\n },\n );\n expect(nestedSimpleTransformationVisitor).not.toHaveBeenCalled();\n });\n });\n });\n });\n\n describe('omit notation', () => {\n const fieldsToOmit = times(2, () => aString());\n const visitorCallback = jest.fn();\n const sourcePathExpression = '$.d.e.f';\n const path = 'a.b.c';\n const accumulator = {};\n\n beforeEach(() => {\n visitorCallback.mockClear();\n });\n\n describe('top-level transformation', () => {\n test('invokes the TopLevelOmit visitor', () => {\n const transformation = {\n '@source': sourcePathExpression,\n '@omit': fieldsToOmit,\n };\n\n reduceTransformation(transformation, {\n visitors: {\n TopLevelOmit: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n sourcePathExpression,\n fieldsToOmit,\n );\n });\n });\n\n describe('nested transformation', () => {\n test('invokes the NestedOmit visitor', () => {\n const transformation = set({}, path, {\n '@source': sourcePathExpression,\n '@omit': fieldsToOmit,\n });\n\n reduceTransformation(transformation, {\n visitors: {\n NestedOmit: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n sourcePathExpression,\n fieldsToOmit,\n );\n });\n });\n });\n\n describe('error handling', () => {\n describe.each`\n transformation | visitorType\n ${'$.a.b.c'} | ${'TopLevelSimpleTransformationExpression'}\n ${'#someCustomFunc($.a.b.c)'} | ${'TopLevelCustomFunctionExpression'}\n ${{ a: { b: { c: 'unsupported transformation' } } }} | ${'NestedUnsupportedTransformationExpression'}\n ${{ a: { b: { c: '$.d.e.f' } } }} | ${'NestedSimpleTransformationExpression'}\n ${{ '*': '$.d.e.f' }} | ${'TopLevelSpreadExpression'}\n ${{ a: { '*': '$.d.e.f' } }} | ${'NestedSpreadExpression'}\n ${{ a: { b: '#someCustomFunction($.d.e.f)' } }} | ${'CustomFunctionExpression'}\n `('$visitor visitor', ({ transformation, visitorType }) => {\n test(`rethrows the error thrown by the ${visitorType} visitor`, () => {\n const errorMessage = aString();\n const error = new Error(errorMessage);\n const visitorCallback = jest.fn().mockImplementationOnce(() => {\n throw error;\n });\n\n expect(() =>\n reduceTransformation(transformation, {\n visitors: {\n [visitorType]: visitorCallback,\n },\n }),\n ).toThrow(error);\n });\n\n test(`does not fail when the ${visitorType} visitor is missing`, () => {\n expect(() =>\n reduceTransformation(transformation, {\n visitors: {\n [visitorType]: null,\n },\n }),\n ).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AEC,CAAC,EAAE;QAAU;MAAE;IAAE,CAAC,yBAAyB,sCAAsC;AACrG,QAAQ;MAAE,GAAG,EAAE;IAAU,CAAC,qCAAqC,0BAA0B;AACzF,QAAQ;MAAEF,CAAC,EAAE;QAAE,GAAG,EAAE;MAAU;IAAE,CAAC,8BAA8B,wBAAwB;AACvF,QAAQ;MAAEA,CAAC,EAAE;QAAEC,CAAC,EAAE;MAA+B;IAAE,CAAC,WAAW,0BAA0B;AACzF,KAAK,CAAC,kBAAkB,EAAE,CAAC;MAAEf,cAAc;MAAEoE;IAAY,CAAC,KAAK;MACzDzE,IAAI,CAAC,oCAAoCyE,WAAW,UAAU,EAAE,MAAM;QACpE,MAAMC,YAAY,GAAG,IAAA3E,iCAAO,EAAC,CAAC;QAC9B,MAAM4E,KAAK,GAAG,IAAIC,KAAK,CAACF,YAAY,CAAC;QACrC,MAAMzE,eAAe,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC,CAAC0E,sBAAsB,CAAC,MAAM;UAC7D,MAAMF,KAAK;QACb,CAAC,CAAC;QAEFjE,MAAM,CAAC,MACL,IAAAH,0CAAoB,EAACF,cAAc,EAAE;UACnCG,QAAQ,EAAE;YACR,CAACiE,WAAW,GAAGxE;UACjB;QACF,CAAC,CACH,CAAC,CAAC6E,OAAO,CAACH,KAAK,CAAC;MAClB,CAAC,CAAC;MAEF3E,IAAI,CAAC,0BAA0ByE,WAAW,qBAAqB,EAAE,MAAM;QACrE/D,MAAM,CAAC,MACL,IAAAH,0CAAoB,EAACF,cAAc,EAAE;UACnCG,QAAQ,EAAE;YACR,CAACiE,WAAW,GAAG;UACjB;QACF,CAAC,CACH,CAAC,CAAC9B,GAAG,CAACmC,OAAO,CAAC,CAAC;MACjB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_reduceTransformation","describe","visitorCallbackResult","aString","test","visitorCallback","jest","fn","mockReturnValueOnce","transformation","result","reduceTransformation","visitors","TopLevelSimpleTransformationExpression","expect","toHaveBeenCalledTimes","toHaveBeenCalledWith","toStrictEqual","TopLevelCustomFunctionExpression","transformationWithInvalidCustomFunctionExpression","TopLevelUnsupportedTransformationExpression","accumulator","anObject","a","b","c","d","e","NestedSimpleTransformationExpression","topLevelSpreadOperatorCallback","nestedSpreadOperatorCallback","times","argumentExpression","sibling","siblingKeys","Object","keys","path","beforeEach","forEach","mock","mockClear","nestedOmitCallback","omitExpression","TopLevelSpreadExpression","NestedOmit","NestedSpreadExpression","not","toHaveBeenCalled","set","simpleTransformationCallback","anotherArgumentExpression","topLevelArgumentExpression","customFunctionExpressionCallback","customFunctionExpression","CustomFunctionExpression","invalidCustomFunctionExpression","nestedConstantExpressionCallback","undesiredVisitor","someConst","NestedConstantValue","value","countAccumulator","count","unsupportedTransformationValue","NestedUnsupportedTransformationExpression","TopLevelMapArrayItems","withItemTransformation","itemTransformation","MapArrayItems","nestedSimpleTransformationVisitor","yyy","zzz","fieldsToOmit","sourcePathExpression","TopLevelOmit","each","visitorType","errorMessage","error","Error","mockImplementationOnce","toThrow"],"sources":["../../../src/__tests__/reduceTransformation.spec.ts"],"sourcesContent":["import { anObject, aString } from '@wix/motion-runtime-test-context';\nimport { set, times } from 'lodash';\n\nimport { reduceTransformation } from '../lib/transformations/reduceTransformation.js';\n\ndescribe('reduceTransformation', () => {\n describe('simple transformations', () => {\n const visitorCallbackResult = aString();\n\n test('traverses a simple transformation', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformation = '$.a.b.c';\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelSimpleTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith('$.a.b.c');\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n\n describe('custom-functions', () => {\n test('traverses a valid custom-function expression', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformation = '#someCustomFunction($.a.b.c,someOtherArg)';\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelCustomFunctionExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n 'someCustomFunction',\n ['$.a.b.c', 'someOtherArg'],\n transformation,\n );\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n\n test('does not fail for invalid custom-function expression', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformationWithInvalidCustomFunctionExpression = '#($.a.b.c)';\n\n const result = reduceTransformation(\n transformationWithInvalidCustomFunctionExpression,\n {\n visitors: {\n TopLevelCustomFunctionExpression: visitorCallback,\n },\n },\n );\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n null,\n null,\n transformationWithInvalidCustomFunctionExpression,\n );\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n });\n\n // TODO: replace with returning the invalid value, for constant-transformation\n test('invokes the TopLevelUnsupportedTransformationExpression otherwise', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n\n const transformation = aString();\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelUnsupportedTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(transformation);\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n });\n\n describe('complex transformation', () => {\n const accumulator = anObject();\n\n test('traverses all string nodes that are transformation expressions', () => {\n const visitorCallback = jest.fn();\n\n const transformation = {\n a: {\n b: { c: '$[0].ddd.eee.ffff' },\n d: 2,\n e: ['$.ggg', 3, 4, 5],\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSimpleTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(2);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b.c',\n '$[0].ddd.eee.ffff',\n );\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.e[0]',\n '$.ggg',\n );\n });\n\n describe('spread operator', () => {\n const [topLevelSpreadOperatorCallback, nestedSpreadOperatorCallback] =\n times(2, () => jest.fn());\n const argumentExpression = '$[1].d.e.f';\n const sibling = anObject();\n const siblingKeys = Object.keys(sibling);\n const path = `${siblingKeys[0]}.b.c`;\n\n beforeEach(() => {\n [topLevelSpreadOperatorCallback, nestedSpreadOperatorCallback].forEach(\n (mock) => mock.mockClear(),\n );\n });\n\n test('invokes the spread operator visitor prior to its children', () => {\n const nestedOmitCallback = jest.fn();\n const omitExpression = {\n '@source': argumentExpression,\n '@omit': times(2, () => aString()),\n };\n const transformation = { '*': omitExpression, ...sibling };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedOmit: nestedOmitCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n omitExpression,\n siblingKeys,\n );\n\n // expect(nestedOmitCallback).toHaveBeenCalled();\n });\n\n test('traverses top-level spread-operator transformation nodes', () => {\n const transformation = { '*': argumentExpression, ...sibling };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n argumentExpression,\n siblingKeys,\n );\n expect(nestedSpreadOperatorCallback).not.toHaveBeenCalled();\n });\n\n test('traverses nested spread-operator transformation nodes', () => {\n const transformation = set({}, path, {\n '*': argumentExpression,\n ...sibling,\n });\n const simpleTransformationCallback = jest.fn();\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).not.toHaveBeenCalled();\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n argumentExpression,\n siblingKeys,\n );\n });\n\n test('traverses items within an array of a spread-operator transformation nodes', () => {\n const simpleTransformationCallback = jest.fn();\n const transformation = set({}, path, {\n '*': ['$[0].x.y.z', '$[1].d.e.f'],\n ...sibling,\n });\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(2);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$[0].x.y.z',\n siblingKeys,\n );\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$[1].d.e.f',\n siblingKeys,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n\n test('sets the path to be the parent of the spread operator', () => {\n const anotherArgumentExpression = '$[0].x.y.z';\n const topLevelArgumentExpression = '$[1]';\n const transformation = set(\n { '*': topLevelArgumentExpression, ...sibling },\n path,\n {\n '*': [anotherArgumentExpression, argumentExpression],\n },\n );\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n },\n });\n\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(2);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n argumentExpression,\n [],\n );\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n anotherArgumentExpression,\n [],\n );\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n topLevelArgumentExpression,\n siblingKeys,\n );\n });\n });\n\n describe('custom functions', () => {\n test('traverses custom-function nodes', () => {\n const customFunctionExpressionCallback = jest.fn();\n const simpleTransformationCallback = jest.fn();\n const customFunctionExpression =\n '#someCustomFunction($[0].someCustomFunction)';\n const transformation = {\n a: {\n b: customFunctionExpression,\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n CustomFunctionExpression: customFunctionExpressionCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(customFunctionExpressionCallback).toHaveBeenCalledTimes(1);\n expect(customFunctionExpressionCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b',\n 'someCustomFunction',\n ['$[0].someCustomFunction'],\n customFunctionExpression,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n\n test('does not fail on invalid custom-function nodes', () => {\n const customFunctionExpressionCallback = jest.fn();\n const simpleTransformationCallback = jest.fn();\n const invalidCustomFunctionExpression = '#($[0].someCustomFunction)';\n\n const transformation = {\n a: {\n b: invalidCustomFunctionExpression,\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n CustomFunctionExpression: customFunctionExpressionCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(customFunctionExpressionCallback).toHaveBeenCalledTimes(1);\n expect(customFunctionExpressionCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b',\n null,\n null,\n invalidCustomFunctionExpression,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n });\n\n describe('constant annotation', () => {\n test('traverses a nested constant annotation expression', () => {\n const nestedConstantExpressionCallback = jest.fn();\n const undesiredVisitor = jest.fn();\n const transformation = {\n a: { b: { c: { '@constant': { someConst: '$.value123' } } } },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedConstantValue: nestedConstantExpressionCallback,\n NestedSimpleTransformationExpression: undesiredVisitor,\n },\n });\n\n expect(nestedConstantExpressionCallback).toHaveBeenCalledTimes(1);\n expect(nestedConstantExpressionCallback).toHaveBeenCalledWith({\n accumulator,\n path: 'a.b.c',\n value: { someConst: '$.value123' },\n });\n expect(undesiredVisitor).not.toHaveBeenCalled();\n });\n });\n\n test('returns the accumulator with changes made to it', () => {\n const countAccumulator = { count: 0 };\n\n const transformation = {\n a: {\n b: 1,\n '*': '$[0].a.b.c',\n },\n };\n\n const result = reduceTransformation(transformation, {\n accumulator: countAccumulator,\n visitors: {\n NestedSpreadExpression: () => {\n countAccumulator.count += 1;\n },\n },\n });\n\n expect(result).toStrictEqual({ count: 1 });\n });\n\n // TODO: replace with returning the invalid value, for constant-transformation\n test('invokes the NestedUnsupportedTransformationExpression otherwise', () => {\n const visitorCallback = jest.fn();\n const unsupportedTransformationValue = aString();\n const transformation = {\n a: { b: { c: unsupportedTransformationValue } },\n };\n\n reduceTransformation(transformation, {\n visitors: {\n NestedUnsupportedTransformationExpression: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b.c',\n unsupportedTransformationValue,\n );\n });\n });\n\n describe('mapping array items', () => {\n const visitorCallback = jest.fn();\n\n beforeEach(() => {\n visitorCallback.mockClear();\n });\n\n describe('top-level transformation', () => {\n test('invokes the TopLevelMapArrayItems visitor', () => {\n const transformation = {\n '@path': '$.d.e.f',\n '@itemTransformation': '$.g.h.i',\n };\n\n reduceTransformation(transformation, {\n visitors: {\n TopLevelMapArrayItems: visitorCallback,\n },\n accumulator: {},\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith('$.d.e.f', '$.g.h.i');\n });\n });\n\n describe('nested transformation', () => {\n const accumulator = {};\n const path = 'a.b.c';\n\n const withItemTransformation = (itemTransformation) =>\n set({}, path, {\n '@path': '$.d.e.f',\n '@itemTransformation': itemTransformation,\n });\n\n describe('simple item-transformation', () => {\n test('invokes the MapArrayItems visitor', () => {\n reduceTransformation(withItemTransformation('$.g.h.i'), {\n visitors: {\n MapArrayItems: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$.d.e.f',\n '$.g.h.i',\n );\n });\n });\n\n describe('complex item-transformation', () => {\n test('invokes the MapArrayItems visitor', () => {\n const nestedSimpleTransformationVisitor = jest.fn();\n\n reduceTransformation(\n withItemTransformation({ yyy: '$.g.h.i', zzz: '$.j.k.l' }),\n {\n visitors: {\n MapArrayItems: visitorCallback,\n NestedSimpleTransformationExpression:\n nestedSimpleTransformationVisitor,\n },\n accumulator,\n },\n );\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$.d.e.f',\n {\n yyy: '$.g.h.i',\n zzz: '$.j.k.l',\n },\n );\n expect(nestedSimpleTransformationVisitor).not.toHaveBeenCalled();\n });\n });\n });\n });\n\n describe('omit notation', () => {\n const fieldsToOmit = times(2, () => aString());\n const visitorCallback = jest.fn();\n const sourcePathExpression = '$.d.e.f';\n const path = 'a.b.c';\n const accumulator = {};\n\n beforeEach(() => {\n visitorCallback.mockClear();\n });\n\n describe('top-level transformation', () => {\n test('invokes the TopLevelOmit visitor', () => {\n const transformation = {\n '@source': sourcePathExpression,\n '@omit': fieldsToOmit,\n };\n\n reduceTransformation(transformation, {\n visitors: {\n TopLevelOmit: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n sourcePathExpression,\n fieldsToOmit,\n );\n });\n });\n\n describe('nested transformation', () => {\n test('invokes the NestedOmit visitor', () => {\n const transformation = set({}, path, {\n '@source': sourcePathExpression,\n '@omit': fieldsToOmit,\n });\n\n reduceTransformation(transformation, {\n visitors: {\n NestedOmit: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n sourcePathExpression,\n fieldsToOmit,\n );\n });\n });\n });\n\n describe('error handling', () => {\n describe.each`\n transformation | visitorType\n ${'$.a.b.c'} | ${'TopLevelSimpleTransformationExpression'}\n ${'#someCustomFunc($.a.b.c)'} | ${'TopLevelCustomFunctionExpression'}\n ${{ a: { b: { c: 'unsupported transformation' } } }} | ${'NestedUnsupportedTransformationExpression'}\n ${{ a: { b: { c: '$.d.e.f' } } }} | ${'NestedSimpleTransformationExpression'}\n ${{ '*': '$.d.e.f' }} | ${'TopLevelSpreadExpression'}\n ${{ a: { '*': '$.d.e.f' } }} | ${'NestedSpreadExpression'}\n ${{ a: { b: '#someCustomFunction($.d.e.f)' } }} | ${'CustomFunctionExpression'}\n `('$visitor visitor', ({ transformation, visitorType }) => {\n test(`rethrows the error thrown by the ${visitorType} visitor`, () => {\n const errorMessage = aString();\n const error = new Error(errorMessage);\n const visitorCallback = jest.fn().mockImplementationOnce(() => {\n throw error;\n });\n\n expect(() =>\n reduceTransformation(transformation, {\n visitors: {\n [visitorType]: visitorCallback,\n },\n }),\n ).toThrow(error);\n });\n\n test(`does not fail when the ${visitorType} visitor is missing`, () => {\n expect(() =>\n reduceTransformation(transformation, {\n visitors: {\n [visitorType]: null,\n },\n }),\n ).not.toThrow();\n });\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,qBAAA,GAAAF,OAAA;A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F,CAAC,EAAE;QAAE,GAAG,EAAE;MAAU;IAAE,CAAC,8BAA8B,wBAAwB;AACvF,QAAQ;MAAEA,CAAC,EAAE;QAAEC,CAAC,EAAE;MAA+B;IAAE,CAAC,WAAW,0BAA0B;AACzF,KAAK,CAAC,kBAAkB,EAAE,CAAC;MAAEf,cAAc;MAAEoE;IAAY,CAAC,KAAK;MACzDzE,IAAI,CAAC,oCAAoCyE,WAAW,UAAU,EAAE,MAAM;QACpE,MAAMC,YAAY,GAAG,IAAA3E,iCAAO,EAAC,CAAC;QAC9B,MAAM4E,KAAK,GAAG,IAAIC,KAAK,CAACF,YAAY,CAAC;QACrC,MAAMzE,eAAe,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC,CAAC0E,sBAAsB,CAAC,MAAM;UAC7D,MAAMF,KAAK;QACb,CAAC,CAAC;QAEFjE,MAAM,CAAC,MACL,IAAAH,0CAAoB,EAACF,cAAc,EAAE;UACnCG,QAAQ,EAAE;YACR,CAACiE,WAAW,GAAGxE;UACjB;QACF,CAAC,CACH,CAAC,CAAC6E,OAAO,CAACH,KAAK,CAAC;MAClB,CAAC,CAAC;MAEF3E,IAAI,CAAC,0BAA0ByE,WAAW,qBAAqB,EAAE,MAAM;QACrE/D,MAAM,CAAC,MACL,IAAAH,0CAAoB,EAACF,cAAc,EAAE;UACnCG,QAAQ,EAAE;YACR,CAACiE,WAAW,GAAG;UACjB;QACF,CAAC,CACH,CAAC,CAAC9B,GAAG,CAACmC,OAAO,CAAC,CAAC;MACjB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _motionRuntimeTestContext = require("@wix/motion-runtime-test-context");
|
|
4
4
|
var _lodash = require("lodash");
|
|
5
|
-
var
|
|
6
|
-
var _customFunctions = require("../../lib/transformations/custom-functions");
|
|
5
|
+
var _index = require("../../index.js");
|
|
6
|
+
var _customFunctions = require("../../lib/transformations/custom-functions.js");
|
|
7
7
|
describe('parseCustomFunctionCall', () => {
|
|
8
8
|
/* eslint-disable max-len */
|
|
9
9
|
test.each`
|
|
@@ -19,7 +19,7 @@ describe('parseCustomFunctionCall', () => {
|
|
|
19
19
|
}) => {
|
|
20
20
|
const functionName = (0, _motionRuntimeTestContext.aString)();
|
|
21
21
|
const functionExpression = `#${functionName}(${argumentExpressions})`;
|
|
22
|
-
expect((0,
|
|
22
|
+
expect((0, _index.parseCustomFunctionCall)(functionExpression)).toStrictEqual({
|
|
23
23
|
functionName,
|
|
24
24
|
argumentExpressions: expectedArgumentExpressions
|
|
25
25
|
});
|
|
@@ -35,7 +35,7 @@ describe('isFunctionCallExpression', () => {
|
|
|
35
35
|
expression,
|
|
36
36
|
expectedResult
|
|
37
37
|
}) => {
|
|
38
|
-
expect((0,
|
|
38
|
+
expect((0, _index.isFunctionCallExpression)(expression)).toStrictEqual(expectedResult);
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
describe('runCustomFunctionCallExpression', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","
|
|
1
|
+
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_index","_customFunctions","describe","test","each","argumentExpressions","expectedArgumentExpressions","functionName","aString","functionExpression","expect","parseCustomFunctionCall","toStrictEqual","expression","expectedResult","isFunctionCallExpression","value","transformationParentPath","joinWithDots","args","join","argumentValues","customFunctions","set","result","runCustomFunctionCallExpression","times","toThrow","Error","t","RegExp"],"sources":["../../../../src/__tests__/transformations/custom-functions.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { set, times } from 'lodash';\n\nimport {\n isFunctionCallExpression,\n parseCustomFunctionCall,\n} from '../../index.js';\nimport { runCustomFunctionCallExpression } from '../../lib/transformations/custom-functions.js';\n\ndescribe('parseCustomFunctionCall', () => {\n /* eslint-disable max-len */\n test.each`\n argumentCount | argumentExpressions | expectedArgumentExpressions\n ${'a single argument'} | ${'$[0].some.path'} | ${['$[0].some.path']}\n ${'multiple arguments'} | ${'$[0].some.path,someString'} | ${['$[0].some.path', 'someString']}\n ${'multiple arguments with whitespaces'} | ${'$[0].some.path, someString , $[1]'} | ${['$[0].some.path', 'someString', '$[1]']}\n ${'no arguments'} | ${''} | ${[]}\n `(\n /* eslint-enable max-len */\n 'parses a custom-function call applied with $argumentCount',\n ({ argumentExpressions, expectedArgumentExpressions }) => {\n const functionName = aString();\n const functionExpression = `#${functionName}(${argumentExpressions})`;\n\n expect(parseCustomFunctionCall(functionExpression)).toStrictEqual({\n functionName,\n argumentExpressions: expectedArgumentExpressions,\n });\n },\n );\n});\n\ndescribe('isFunctionCallExpression', () => {\n test.each`\n description | expression | expectedResult\n ${'a #-prefixed with a valid function name'} | ${'#someInvalidName$#@#>'} | ${true}\n ${'a non-# prefixed with a valid function name'} | ${'someFunctions($[1])'} | ${false}\n ${'a non-string value'} | ${[1, 2, 3]} | ${false}\n `(\n 'returns $expectedResult when $description function call expression is provided',\n ({ expression, expectedResult }) => {\n expect(isFunctionCallExpression(expression)).toStrictEqual(\n expectedResult,\n );\n },\n );\n});\n\ndescribe('runCustomFunctionCallExpression', () => {\n const value = aString();\n const transformationParentPath = aString();\n const joinWithDots = (...args) => args.join('|');\n\n describe.each`\n argumentCount | argumentValues | expectedResult\n ${'single'} | ${[value]} | ${value}\n ${'multi'} | ${[value, value]} | ${`${value}|${value}`}\n ${'no'} | ${[]} | ${''}\n `(\n '$argumentCount-argument expression',\n ({ argumentValues, expectedResult }) => {\n describe.each`\n functionName | description\n ${'someFunction'} | ${'an unscoped'}\n ${'someScope.someFunction'} | ${'a scoped'}\n `('$description custom function', ({ functionName }) => {\n const customFunctions = set({}, functionName, joinWithDots);\n\n test('runs it and returns its result', () => {\n const result = runCustomFunctionCallExpression({\n functionName,\n customFunctions,\n argumentValues,\n transformationParentPath,\n });\n\n expect(result).toStrictEqual(expectedResult);\n });\n });\n },\n );\n\n describe('error handling', () => {\n const argumentValues = times(2, () => aString());\n\n test('throws when the function is not recognized', () => {\n const customFunctions = {};\n\n expect(() =>\n runCustomFunctionCallExpression({\n functionName: 'someNonexistentFunction',\n customFunctions,\n argumentValues,\n transformationParentPath,\n }),\n ).toThrow(`unrecognized custom function \"someNonexistentFunction\"`);\n });\n\n test('throws an error when the function call throws an error', () => {\n const functionName = aString();\n\n const customFunctions = {\n [functionName]: () => {\n throw new Error('Something went wrong in the custom function');\n },\n };\n\n const t = () =>\n runCustomFunctionCallExpression({\n functionName,\n customFunctions,\n argumentValues,\n transformationParentPath,\n });\n\n expect(t).toThrow(Error);\n expect(t).toThrow(\n new RegExp(\n `Transforming ${transformationParentPath} failed, #${functionName} threw: \"Something went wrong in the custom function\" for arguments: .+`,\n ),\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAIA,IAAAG,gBAAA,GAAAH,OAAA;AAEAI,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACxC;EACAC,IAAI,CAACC,IAAI;AACX;AACA,MAAM,mBAAmB,wBAAwB,gBAAgB,2BAA2B,CAAC,gBAAgB,CAAC;AAC9G,MAAM,oBAAoB,uBAAuB,2BAA2B,gBAAgB,CAAC,gBAAgB,EAAE,YAAY,CAAC;AAC5H,MAAM,qCAAqC,MAAM,qCAAqC,MAAM,CAAC,gBAAgB,EAAE,YAAY,EAAE,MAAM,CAAC;AACpI,MAAM,cAAc,6BAA6B,EAAE,yCAAyC,EAAE;AAC9F,GAAG,CACC;EACA,2DAA2D,EAC3D,CAAC;IAAEC,mBAAmB;IAAEC;EAA4B,CAAC,KAAK;IACxD,MAAMC,YAAY,GAAG,IAAAC,iCAAO,EAAC,CAAC;IAC9B,MAAMC,kBAAkB,GAAG,IAAIF,YAAY,IAAIF,mBAAmB,GAAG;IAErEK,MAA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,KAAK,CAAC;MACxBlB,MAAM,CAACmB,CAAC,CAAC,CAACF,OAAO,CACf,IAAIG,MAAM,CACR,gBAAgBb,wBAAwB,aAAaV,YAAY,yEACnE,CACF,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var _motionRuntimeTestContext = require("@wix/motion-runtime-test-context");
|
|
4
4
|
var _lodash = require("lodash");
|
|
5
|
-
var
|
|
5
|
+
var _index = require("../../../index.js");
|
|
6
6
|
const {
|
|
7
7
|
create: {
|
|
8
8
|
buildRequestTransformation,
|
|
9
9
|
buildResponseTransformation
|
|
10
10
|
}
|
|
11
|
-
} =
|
|
11
|
+
} = _index.preset;
|
|
12
12
|
describe('create-method transformations', () => {
|
|
13
13
|
describe('buildRequestTransformation', () => {
|
|
14
14
|
test('creates a transformation that maps the first argument into requestMessageEntityPath', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","
|
|
1
|
+
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_index","create","buildRequestTransformation","buildResponseTransformation","preset","describe","test","requestMessageEntityPath","aString","tranformationObject","expect","toStrictEqual","entityPathSegments","times","join","responseMessageResultPath","tranformationString"],"sources":["../../../../../src/__tests__/transformations/preset/create-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../../index.js';\n\nconst {\n create: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('create-method transformations', () => {\n describe('buildRequestTransformation', () => {\n test('creates a transformation that maps the first argument into requestMessageEntityPath', () => {\n const requestMessageEntityPath = aString();\n\n const tranformationObject = buildRequestTransformation({\n requestMessageEntityPath,\n });\n\n expect(tranformationObject).toStrictEqual({\n [requestMessageEntityPath]: '$[0]',\n });\n });\n\n test('supports nested paths', () => {\n // @ts-expect-error\n const entityPathSegments = times(2, aString);\n const requestMessageEntityPath = entityPathSegments.join('.');\n\n const tranformationObject = buildRequestTransformation({\n requestMessageEntityPath,\n });\n\n expect(tranformationObject).toStrictEqual({\n [entityPathSegments[0]]: { [entityPathSegments[1]]: '$[0]' },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const tranformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(tranformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,MAAM;EACJG,MAAM,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACpE,CAAC,GAAGC,aAAM;AAEVC,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3CC,IAAI,CAAC,qFAAqF,EAAE,MAAM;MAChG,MAAMC,wBAAwB,GAAG,IAAAC,iCAAO,EAAC,CAAC;MAE1C,MAAMC,mBAAmB,GAAGP,0BAA0B,CAAC;QACrDK;MACF,CAAC,CAAC;MAEFG,MAAM,CAACD,mBAAmB,CAAC,CAACE,aAAa,CAAC;QACxC,CAACJ,wBAAwB,GAAG;MAC9B,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFD,IAAI,CAAC,uBAAuB,EAAE,MAAM;MAClC;MACA,MAAMM,kBAAkB,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAEL,iCAAO,CAAC;MAC5C,MAAMD,wBAAwB,GAAGK,kBAAkB,CAACE,IAAI,CAAC,GAAG,CAAC;MAE7D,MAAML,mBAAmB,GAAGP,0BAA0B,CAAC;QACrDK;MACF,CAAC,CAAC;MAEFG,MAAM,CAACD,mBAAmB,CAAC,CAACE,aAAa,CAAC;QACxC,CAACC,kBAAkB,CAAC,CAAC,CAAC,GAAG;UAAE,CAACA,kBAAkB,CAAC,CAAC,CAAC,GAAG;QAAO;MAC7D,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFP,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CC,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMS,yBAAyB,GAAG,IAAAP,iCAAO,EAAC,CAAC;MAE3C,MAAMQ,mBAAmB,GAAGb,2BAA2B,CAAC;QACtDY;MACF,CAAC,CAAC;MAEFL,MAAM,CAACM,mBAAmB,CAAC,CAACL,aAAa,CACvC,KAAKI,yBAAyB,EAChC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
var _motionRuntimeTestContext = require("@wix/motion-runtime-test-context");
|
|
4
4
|
var _lodash = require("lodash");
|
|
5
|
-
var
|
|
5
|
+
var _index = require("../../../index.js");
|
|
6
6
|
const {
|
|
7
7
|
RESPONSE_OBJECT_UNCHANGED
|
|
8
|
-
} =
|
|
8
|
+
} = _index.transformations;
|
|
9
9
|
const {
|
|
10
10
|
delete: {
|
|
11
11
|
buildRequestTransformation,
|
|
12
12
|
buildResponseTransformation
|
|
13
13
|
}
|
|
14
|
-
} =
|
|
14
|
+
} = _index.preset;
|
|
15
15
|
describe('delete-method transformations', () => {
|
|
16
16
|
describe('buildRequestTransformation', () => {
|
|
17
17
|
const requestMessageIdentifierPath = (0, _motionRuntimeTestContext.aString)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","
|
|
1
|
+
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_index","RESPONSE_OBJECT_UNCHANGED","transformations","delete","buildRequestTransformation","buildResponseTransformation","preset","describe","requestMessageIdentifierPath","aString","test","transformationObject","expect","toStrictEqual","requestMessageOptionsPath","sharedPath","identifierPathSegment","idPathSegments","times","optionsPathSegments","join","trasformationString"],"sources":["../../../../../src/__tests__/transformations/preset/delete-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset, transformations } from '../../../index.js';\n\nconst { RESPONSE_OBJECT_UNCHANGED } = transformations;\nconst {\n delete: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('delete-method transformations', () => {\n describe('buildRequestTransformation', () => {\n const requestMessageIdentifierPath = aString();\n\n test('creates a transformation that maps the first argument into requestMessageIdentifierPath', () => {\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageIdentifierPath]: '$[0]',\n });\n });\n\n test(`creates a transformation that maps the 2nd argument into requestMessageOptionsPath when provided`, () => {\n const requestMessageOptionsPath = aString();\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath,\n requestMessageOptionsPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageIdentifierPath]: '$[0]',\n [requestMessageOptionsPath]: '$[1]',\n });\n });\n\n test('supports shared paths for requestMessageIdentifierPath and requestMessageOptionsPath', () => {\n const sharedPath = aString();\n const identifierPathSegment = aString();\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath: `${sharedPath}.${identifierPathSegment}`,\n requestMessageOptionsPath: sharedPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [sharedPath]: { [identifierPathSegment]: '$[0]', '*': '$[1]' },\n });\n });\n\n test('supports nested paths', () => {\n // @ts-expect-error\n const idPathSegments = times(2, aString);\n // @ts-expect-error\n const optionsPathSegments = times(2, aString);\n\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath: idPathSegments.join('.'),\n requestMessageOptionsPath: optionsPathSegments.join('.'),\n });\n\n expect(transformationObject).toStrictEqual({\n [idPathSegments[0]]: { [idPathSegments[1]]: '$[0]' },\n [optionsPathSegments[0]]: { [optionsPathSegments[1]]: '$[1]' },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('returns the identity transformation', () => {\n const trasformationString = buildResponseTransformation();\n\n expect(trasformationString).toStrictEqual(RESPONSE_OBJECT_UNCHANGED);\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,MAAM;EAAEG;AAA0B,CAAC,GAAGC,sBAAe;AACrD,MAAM;EACJC,MAAM,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACpE,CAAC,GAAGC,aAAM;AAEVC,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3C,MAAMC,4BAA4B,GAAG,IAAAC,iCAAO,EAAC,CAAC;IAE9CC,IAAI,CAAC,yFAAyF,EAAE,MAAM;MACpG,MAAMC,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI;MACF,CAAC,CAAC;MAEFI,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACL,4BAA4B,GAAG;MAClC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFE,IAAI,CAAC,kGAAkG,EAAE,MAAM;MAC7G,MAAMI,yBAAyB,GAAG,IAAAL,iCAAO,EAAC,CAAC;MAC3C,MAAME,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI,4BAA4B;QAC5BM;MACF,CAAC,CAAC;MAEFF,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACL,4BAA4B,GAAG,MAAM;QACtC,CAACM,yBAAyB,GAAG;MAC/B,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFJ,IAAI,CAAC,sFAAsF,EAAE,MAAM;MACjG,MAAMK,UAAU,GAAG,IAAAN,iCAAO,EAAC,CAAC;MAC5B,MAAMO,qBAAqB,GAAG,IAAAP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;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var _motionRuntimeTestContext = require("@wix/motion-runtime-test-context");
|
|
4
4
|
var _lodash = require("lodash");
|
|
5
|
-
var
|
|
5
|
+
var _index = require("../../../index.js");
|
|
6
6
|
const {
|
|
7
7
|
get: {
|
|
8
8
|
buildRequestTransformation,
|
|
9
9
|
buildResponseTransformation
|
|
10
10
|
}
|
|
11
|
-
} =
|
|
11
|
+
} = _index.preset;
|
|
12
12
|
describe('get-method transformations', () => {
|
|
13
13
|
describe('buildRequestTransformation', () => {
|
|
14
14
|
const requestMessageIdentifierPath = (0, _motionRuntimeTestContext.aString)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","
|
|
1
|
+
{"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_index","get","buildRequestTransformation","buildResponseTransformation","preset","describe","requestMessageIdentifierPath","aString","test","transformationObject","expect","toStrictEqual","idPathSegments","times","join","responseMessageResultPath","transformationString"],"sources":["../../../../../src/__tests__/transformations/preset/get-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../../index.js';\n\nconst {\n get: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('get-method transformations', () => {\n describe('buildRequestTransformation', () => {\n const requestMessageIdentifierPath = aString();\n\n test('creates a transformation that maps the first argument into requestMessageIdentifierPath', () => {\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageIdentifierPath]: '$[0]',\n });\n });\n\n test('supports a nested path', () => {\n // @ts-expect-errora\n const idPathSegments = times(2, aString);\n\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath: idPathSegments.join('.'),\n });\n\n expect(transformationObject).toStrictEqual({\n [idPathSegments[0]]: { [idPathSegments[1]]: '$[0]' },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const transformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(transformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,MAAM;EACJG,GAAG,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACjE,CAAC,GAAGC,aAAM;AAEVC,QAAQ,CAAC,4BAA4B,EAAE,MAAM;EAC3CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3C,MAAMC,4BAA4B,GAAG,IAAAC,iCAAO,EAAC,CAAC;IAE9CC,IAAI,CAAC,yFAAyF,EAAE,MAAM;MACpG,MAAMC,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI;MACF,CAAC,CAAC;MAEFI,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACL,4BAA4B,GAAG;MAClC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFE,IAAI,CAAC,wBAAwB,EAAE,MAAM;MACnC;MACA,MAAMI,cAAc,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAEN,iCAAO,CAAC;MAExC,MAAME,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI,4BAA4B,EAAEM,cAAc,CAACE,IAAI,CAAC,GAAG;MACvD,CAAC,CAAC;MAEFJ,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACC,cAAc,CAAC,CAAC,CAAC,GAAG;UAAE,CAACA,cAAc,CAAC,CAAC,CAAC,GAAG;QAAO;MACrD,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFP,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CG,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMO,yBAAyB,GAAG,IAAAR,iCAAO,EAAC,CAAC;MAE3C,MAAMS,oBAAoB,GAAGb,2BAA2B,CAAC;QACvDY;MACF,CAAC,CAAC;MAEFL,MAAM,CAACM,oBAAoB,CAAC,CAACL,aAAa,CACxC,KAAKI,yBAAyB,EAChC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _motionRuntimeTestContext = require("@wix/motion-runtime-test-context");
|
|
4
|
-
var
|
|
4
|
+
var _index = require("../../../index.js");
|
|
5
5
|
const {
|
|
6
6
|
list: {
|
|
7
7
|
buildRequestTransformation,
|
|
8
8
|
buildResponseTransformation
|
|
9
9
|
}
|
|
10
|
-
} =
|
|
10
|
+
} = _index.preset;
|
|
11
11
|
describe('list-method transformations', () => {
|
|
12
12
|
describe('buildRequestTransformation', () => {
|
|
13
13
|
// eslint-disable-next-line max-len
|