mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 19:43:53 +08:00
18 lines
590 B
JavaScript
18 lines
590 B
JavaScript
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/);
|
|
});
|