فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
test(A08): verify deterministic synthetic baseline fixture
davoodmehraban89 committed
Oct 14, 2026 at 23:20 UTC
33ad10aeb5d9ace31ed9d319b3f9e782649b8db7
1 file changed
+18
tests/a08-benchmark-fixtures.test.mjs
new
+18
@@ -0,0 +1,18 @@
1
+import test from 'node:test';
2
+import assert from 'node:assert/strict';
3
+import { COUNTS, syntheticRecord } from '../scripts/a08-benchmark.mjs';
4
+
5
+test('A08 synthetic fixture is stable, bounded and has no personal information', () => {
6
+ assert.deepEqual(COUNTS, { products: 10_000, invoices: 50_000, companies: 5 });
7
+ for (const store of ['products', 'invoices']) {
8
+ const first = syntheticRecord(store, 0);
9
+ const second = syntheticRecord(store, 1);
10
+ assert.deepEqual(syntheticRecord(store, 0), first);
11
+ assert.equal(first.companyId, 'benchmark-c0');
12
+ assert.equal(second.companyId, 'benchmark-c1');
13
+ assert.notEqual(first.id, second.id);
14
+ assert.equal(first.ownerUserId, 'bench-admin');
15
+ }
16
+ assert.equal(syntheticRecord('invoices', 49_999).companyId, 'benchmark-c4');
17
+ assert.throws(() => syntheticRecord('users', 0));
18
+});