mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
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:
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user