mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 19:43:53 +08:00
fix(manager): align frontend and backend field contracts
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import test from 'node:test';
|
||||
|
||||
const timbreApiSource = await readFile(
|
||||
new URL('../src/apis/module/timbre.js', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
|
||||
test('timbre update sends the current sort value to the backend', () => {
|
||||
const updateStart = timbreApiSource.indexOf('updateVoice(params, callback)');
|
||||
|
||||
assert.notEqual(updateStart, -1);
|
||||
const updateSource = timbreApiSource.slice(updateStart);
|
||||
assert.match(updateSource, /\.method\('PUT'\)/);
|
||||
assert.match(updateSource, /sort:\s*params\.sort/);
|
||||
});
|
||||
Reference in New Issue
Block a user