ci: Expand ESLint to tests in BE packages (no-changelog) (#6147)

* 🔧 Adjust base ESLint config

* 🔧 Adjust `lint` and `lintfix` in `nodes-base`

* 🔧 Include `test` and `utils` in `nodes-base`

* 📘 Convert JS tests to TS

* 👕 Apply lintfixes
This commit is contained in:
Iván Ovejero
2023-05-02 10:37:19 +02:00
committed by GitHub
parent c63181b317
commit 06fa6f1fb3
59 changed files with 390 additions and 307 deletions

View File

@@ -25,9 +25,7 @@ describe('Data Transformation Functions', () => {
{ value: 6, string: '6' },
{ value: { something: 'else' } }
].pluck("value") }}`),
).toEqual(
expect.arrayContaining([1, 2, 3, 4, 5, 6, { something: 'else' }]),
);
).toEqual(expect.arrayContaining([1, 2, 3, 4, 5, 6, { something: 'else' }]));
});
test('.pluck() should work correctly for multiple values', () => {
@@ -50,7 +48,10 @@ describe('Data Transformation Functions', () => {
}
].pluck("firstName", "lastName") }}`),
).toEqual(
expect.arrayContaining([["John", "Doe"],["Jane", "Doe"]]),
expect.arrayContaining([
['John', 'Doe'],
['Jane', 'Doe'],
]),
);
});
@@ -73,7 +74,7 @@ describe('Data Transformation Functions', () => {
{ value: 4, string: '4' },
{ value: 5, string: '5' },
{ value: 6, string: '6' },
{ value: { something: 'else' } }
{ value: { something: 'else' } },
]),
);
});
@@ -86,10 +87,8 @@ describe('Data Transformation Functions', () => {
test('.unique() should work on an arrays containing nulls, objects and arrays', () => {
expect(
evaluate(
'={{ [1, 2, 3, "as", {}, {}, 1, 2, [1,2], "[sad]", "[sad]", null].unique() }}',
),
).toEqual([1, 2, 3, "as", {}, [1,2], "[sad]", null]);
evaluate('={{ [1, 2, 3, "as", {}, {}, 1, 2, [1,2], "[sad]", "[sad]", null].unique() }}'),
).toEqual([1, 2, 3, 'as', {}, [1, 2], '[sad]', null]);
});
test('.isEmpty() should work correctly on an array', () => {
@@ -113,7 +112,7 @@ describe('Data Transformation Functions', () => {
evaluate(
'={{ [{ test1: 1, test2: 2 }, { test1: 1, test3: 3 }].merge([{ test1: 2, test3: 3 }, { test4: 4 }]) }}',
),
).toEqual({"test1": 1, "test2": 2, "test3": 3, "test4": 4});
).toEqual({ test1: 1, test2: 2, test3: 3, test4: 4 });
});
test('.merge() should work correctly without arguments', () => {
@@ -121,7 +120,7 @@ describe('Data Transformation Functions', () => {
evaluate(
'={{ [{ a: 1, some: null }, { a: 2, c: "something" }, 2, "asds", { b: 23 }, null, [1, 2]].merge() }}',
),
).toEqual({"a": 1, "some": null, "c": "something", "b": 23});
).toEqual({ a: 1, some: null, c: 'something', b: 23 });
});
test('.smartJoin() should work correctly on an array of objects', () => {
@@ -175,11 +174,14 @@ describe('Data Transformation Functions', () => {
});
test('.union() should work on an arrays containing nulls, objects and arrays', () => {
expect(
evaluate(
'={{ [1, 2, "dd", {}, null].union([1, {}, null, 3]) }}',
),
).toEqual([1, 2, "dd", {}, null, 3]);
expect(evaluate('={{ [1, 2, "dd", {}, null].union([1, {}, null, 3]) }}')).toEqual([
1,
2,
'dd',
{},
null,
3,
]);
});
test('.intersection() should work on an array of objects', () => {
@@ -191,11 +193,11 @@ describe('Data Transformation Functions', () => {
});
test('.intersection() should work on an arrays containing nulls, objects and arrays', () => {
expect(
evaluate(
'={{ [1, 2, "dd", {}, null].intersection([1, {}, null]) }}',
),
).toEqual([1, {}, null]);
expect(evaluate('={{ [1, 2, "dd", {}, null].intersection([1, {}, null]) }}')).toEqual([
1,
{},
null,
]);
});
test('.difference() should work on an array of objects', () => {
@@ -212,10 +214,8 @@ describe('Data Transformation Functions', () => {
test('.difference() should work on an arrays containing nulls, objects and arrays', () => {
expect(
evaluate(
'={{ [1, 2, "dd", {}, null, ["a", 1]].difference([1, {}, null, ["a", 1]]) }}',
),
).toEqual([2, "dd"]);
evaluate('={{ [1, 2, "dd", {}, null, ["a", 1]].difference([1, {}, null, ["a", 1]]) }}'),
).toEqual([2, 'dd']);
});
test('.compact() should work on an array', () => {