Add firmware and extension catalogues, configuration transactions, sample review and QML diagnostics. Preserve explicit authority, bounded retries and stop recovery in motor transport.
16 lines
1.2 KiB
JavaScript
16 lines
1.2 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import {readFileSync} from 'node:fs';
|
|
import ts from 'typescript';
|
|
const source=readFileSync(new URL('../../../plugins/vesc/frontend/src/firmwareFiles.ts',import.meta.url),'utf8');
|
|
const {firmwareFileError}=await import('data:text/javascript;base64,'+Buffer.from(ts.transpileModule(source,{compilerOptions:{module:ts.ModuleKind.ESNext,target:ts.ScriptTarget.ES2022}}).outputText).toString('base64'));
|
|
test('older engines do not offer HEX; supported files stay bounded before browser allocation',()=>{
|
|
assert.ok(firmwareFileError({name:'firmware.hex',size:1000},'firmware',['bin']));
|
|
assert.equal(firmwareFileError({name:'firmware.HEX',size:8*1024*1024},'firmware',['bin','hex']),null);
|
|
assert.ok(firmwareFileError({name:'firmware.hex',size:8*1024*1024+1},'firmware',['bin','hex']));
|
|
assert.ok(firmwareFileError({name:'firmware.zip',size:1000},'firmware',['bin','hex']));
|
|
assert.ok(firmwareFileError({name:'boot.bin',size:65537},'bootloader',['bin','hex']));
|
|
assert.equal(firmwareFileError({name:'boot.hex',size:100000},'bootloader',['bin','hex']),null);
|
|
assert.ok(firmwareFileError({name:'empty.bin',size:0},'firmware',['bin','hex']));
|
|
});
|