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

@@ -61,7 +61,6 @@ describe('Data Transformation Functions', () => {
expect(evaluate('={{ DateTime.local(2023, 1, 20).extract() }}')).toEqual(3);
});
test('.format("yyyy LLL dd") should work correctly on a date', () => {
expect(evaluate('={{ DateTime.local(2023, 1, 16).format("yyyy LLL dd") }}')).toEqual(
'2023 Jan 16',
@@ -74,27 +73,29 @@ describe('Data Transformation Functions', () => {
});
test('.inBetween() should work on string and Date', () => {
expect(evaluate(`={{ $now.isBetween('2023-06-23'.toDate(), '2023-06-23') }}`)).toBeDefined();
expect(evaluate("={{ $now.isBetween('2023-06-23'.toDate(), '2023-06-23') }}")).toBeDefined();
});
test('.inBetween() should work on string and DateTime', () => {
expect(evaluate(`={{ $now.isBetween($now, '2023-06-23') }}`)).toBeDefined();
expect(evaluate("={{ $now.isBetween($now, '2023-06-23') }}")).toBeDefined();
});
test('.inBetween() should not work for invalid strings', () => {
expect(evaluate(`={{ $now.isBetween($now, 'invalid') }}`)).toBeUndefined();
expect(evaluate("={{ $now.isBetween($now, 'invalid') }}")).toBeUndefined();
});
test('.inBetween() should not work for numbers', () => {
expect(evaluate(`={{ $now.isBetween($now, 1) }}`)).toBeUndefined();
expect(evaluate('={{ $now.isBetween($now, 1) }}')).toBeUndefined();
});
test('.inBetween() should not work for a single argument', () => {
expect(() => evaluate(`={{ $now.isBetween($now) }}`)).toThrow();
expect(() => evaluate('={{ $now.isBetween($now) }}')).toThrow();
});
test('.inBetween() should not work for a more than two arguments', () => {
expect(() => evaluate(`={{ $now.isBetween($now, '2023-06-23', '2023-09-21'.toDate()) }}`)).toThrow();
expect(() =>
evaluate("={{ $now.isBetween($now, '2023-06-23', '2023-09-21'.toDate()) }}"),
).toThrow();
});
});
});