25 lines
849 B
TypeScript
25 lines
849 B
TypeScript
import { readFileSync } from 'node:fs';
|
|
import * as path from 'node:path';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
function readPackageJson() {
|
|
const packageJsonPath = path.resolve(__dirname, '../../package.json');
|
|
return JSON.parse(readFileSync(packageJsonPath, 'utf8')) as {
|
|
scripts?: Record<string, string>;
|
|
};
|
|
}
|
|
|
|
describe('package.json Android 启动脚本', () => {
|
|
it('会启动 xingyun 自己的 Android appId', () => {
|
|
const { scripts = {} } = readPackageJson();
|
|
const androidRunScripts = Object.entries(scripts).filter(([name]) => name.startsWith('run-android'));
|
|
|
|
expect(androidRunScripts.length).toBeGreaterThan(0);
|
|
|
|
for (const [, command] of androidRunScripts) {
|
|
expect(command).toContain('--appId com.jsq.xingyun');
|
|
expect(command).not.toContain('--appId com.cncat.vpn');
|
|
}
|
|
});
|
|
});
|