فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
test(A08): include installed report and encrypted backup contract in npm suite
davoodmehraban89 committed
Oct 31, 2026 at 22:01 UTC
86f78c795d19e69fedce5598c8c92a10aeaa94eb
1 file changed
+8
-7
tests/windows-vm-native-performance-contract.test.mjs
renamed
+8
-7
@@ -1,10 +1,11 @@
1
-'use strict';
2
-const test=require('node:test');
3
-const assert=require('node:assert/strict');
4
-const fs=require('node:fs');
1
+import test from 'node:test';
2
+import assert from 'node:assert/strict';
3
+import { readFileSync } from 'node:fs';
4
+
5
+const read = path => readFileSync(new URL('../' + path, import.meta.url), 'utf8');
6
7
test('A08 native benchmark measures installed report tabs and encrypted full-scale backup',()=>{
7
- const source=fs.readFileSync(new URL('../tests/windows-vm-native-performance-browser.js',import.meta.url),'utf8');
8
+ const source=read('tests/windows-vm-native-performance-browser.js');
9
assert.match(source,/await FINORA\.Router\.go\('reports'\)/);
10
assert.match(source,/window\.ReportsView\._switchTab\(tab\)/);
11
assert.match(source,/window\.SettingsView\.downloadBackup\(\)/);
@@ -15,11 +16,11 @@ test('A08 native benchmark measures installed report tabs and encrypted full-sca
16
});
17
18
test('A08 installed VM runner rejects incomplete report or encrypted-backup measurements',()=>{
18
- const source=fs.readFileSync(new URL('../tests/windows-vm-installed-tauri-cdp.cjs',import.meta.url),'utf8');
19
+ const source=read('tests/windows-vm-installed-tauri-cdp.cjs');
20
assert.match(source,/measured\.reportTabs\?\.\[tab\]\?\.htmlCharacters >= 200/);
21
assert.match(source,/measured\.encryptedBackup\?\.products, 10000/);
22
assert.match(source,/measured\.encryptedBackup\?\.invoices, 50000/);
22
- const lab=fs.readFileSync(new URL('../scripts/windows-vm-native-lab.ps1',import.meta.url),'utf8');
23
+ const lab=read('scripts/windows-vm-native-lab.ps1');
24
assert.match(lab,/\$encryptedBackup\.bytes -lt 100000/);
25
assert.match(lab,/reportsRendered = 4/);
26
});