feat(mobile-app): prepare native app packaging
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import { test } from 'node:test';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
|
||||
const mobileRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
|
||||
test('App 图标与启动图映射均可由预检脚本验证', () => {
|
||||
const output = execFileSync(process.execPath, ['scripts/verify-app-assets.mjs'], {
|
||||
cwd: mobileRoot,
|
||||
encoding: 'utf8'
|
||||
});
|
||||
assert.match(output, /App asset verification passed/);
|
||||
});
|
||||
@@ -451,11 +451,12 @@ test('问师傅恢复旧版语音提问并在录音不可用时回退选择音
|
||||
assert.match(composerSource, /按住 说话/);
|
||||
assert.match(composerSource, /startHold/);
|
||||
assert.match(composerSource, /endHold/);
|
||||
assert.match(composerSource, /navigator\.mediaDevices\?\.getUserMedia/);
|
||||
assert.match(composerSource, /startSpeechCapture/);
|
||||
assert.match(composerSource, /emit\('voice-capture'/);
|
||||
assert.match(composerSource, /emit\('pick-audio'\)/);
|
||||
assert.match(composerSource, /const teardown = \(\) =>/);
|
||||
assert.match(source, /pickVoiceAudio/);
|
||||
assert.match(source, /transcribeSpeechBlob/);
|
||||
assert.match(source, /transcribeSpeechCapture/);
|
||||
assert.match(source, /transcribeSpeechFile/);
|
||||
assert.match(speechService, /\/api\/ai\/asr/);
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ const realtimeVoiceRuntime = async () => {
|
||||
module: runtimeModule,
|
||||
require: (specifier) => {
|
||||
if (specifier === './api') return { apiRequest: async () => ({}) };
|
||||
if (specifier === './speech-capture') return { isNativeAppRuntime: () => false };
|
||||
throw new Error(`Unexpected module: ${specifier}`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ test('语音转写、文字和附件补充都进入无状态整理', async () =>
|
||||
const page = await source('../src/pages/user/report/index.vue');
|
||||
|
||||
assert.match(page, /语音转文字/);
|
||||
assert.match(page, /transcribeSpeechBlob/);
|
||||
assert.match(page, /transcribeSpeechCapture/);
|
||||
assert.match(page, /transcribeSpeechFile/);
|
||||
assert.match(page, /organizeWorkReport\(/);
|
||||
assert.match(page, /const previousDraft = draftPayload\(\)/);
|
||||
|
||||
Reference in New Issue
Block a user