mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
🚀 Release 0.222.0 (#5786)
This commit is contained in:
committed by
GitHub
parent
dd20127961
commit
e92a993694
@@ -18,7 +18,7 @@ describe('jsonParse', () => {
|
||||
});
|
||||
|
||||
describe('jsonStringify', () => {
|
||||
const source: any = { a: 1, b: 2 };
|
||||
const source: any = { a: 1, b: 2, d: new Date(1680089084200), r: new RegExp('^test$', 'ig') };
|
||||
source.c = source;
|
||||
|
||||
it('should throw errors on circular references by default', () => {
|
||||
@@ -27,7 +27,15 @@ describe('jsonStringify', () => {
|
||||
|
||||
it('should break circular references when requested', () => {
|
||||
expect(jsonStringify(source, { replaceCircularRefs: true })).toEqual(
|
||||
'{"a":1,"b":2,"c":"[Circular Reference]"}',
|
||||
'{"a":1,"b":2,"d":"2023-03-29T11:24:44.200Z","r":{},"c":"[Circular Reference]"}',
|
||||
);
|
||||
});
|
||||
|
||||
it('should not detect duplicates as circular references', () => {
|
||||
const y = { z: 5 };
|
||||
const x = [y, y, { y }];
|
||||
expect(jsonStringify(x, { replaceCircularRefs: true })).toEqual(
|
||||
'[{"z":5},{"z":5},{"y":{"z":5}}]',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user