Skip to content

Commit 3da167f

Browse files
committed
another test
1 parent b184df4 commit 3da167f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/bloated.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,27 @@ describe('bloated documents', function() {
8787
assert.strictEqual((error as Error).message, 'Schema analysis aborted: Fields count above 4');
8888
}
8989
});
90+
91+
it('does not count the same field in different documents', async function() {
92+
const documents = [{
93+
field1: {
94+
field2: {
95+
field3: 'abc'
96+
}
97+
}
98+
}, {
99+
field1: {
100+
field2: {
101+
field3: 'bca'
102+
}
103+
}
104+
}];
105+
try {
106+
await getSchema(documents, { distinctFieldsAbortThreshold: 4 });
107+
assert.ok('Analysis finished');
108+
} catch (error) {
109+
assert.fail('Analysis aborted unexpectedly');
110+
}
111+
});
90112
});
91113
});

0 commit comments

Comments
 (0)