We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adf800b commit b184df4Copy full SHA for b184df4
test/bloated.test.ts
@@ -69,5 +69,23 @@ describe('bloated documents', function() {
69
assert.strictEqual((error as Error).message, 'Schema analysis aborted: Fields count above 4');
70
}
71
});
72
+
73
+ it('aborts after reaching the given limit - nested', async function() {
74
+ const documents = [{
75
+ field1: {
76
+ field2: {
77
+ field3: 'abc',
78
+ field4: 'bca'
79
+ },
80
+ field5: 'cab'
81
+ }
82
+ }];
83
+ try {
84
+ await getSchema(documents, { distinctFieldsAbortThreshold: 4 });
85
+ assert.fail('Analysis did not throw');
86
+ } catch (error) {
87
+ assert.strictEqual((error as Error).message, 'Schema analysis aborted: Fields count above 4');
88
89
+ });
90
91
0 commit comments