27 lines
713 B
TypeScript
27 lines
713 B
TypeScript
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
const downloadRoutePath = path.resolve(
|
|
__dirname,
|
|
'..',
|
|
'..',
|
|
'app',
|
|
'api',
|
|
'license',
|
|
'[projectCode]',
|
|
'premium-modules',
|
|
'[moduleId]',
|
|
'route.ts'
|
|
);
|
|
|
|
describe('付费模块下载入口覆盖', () => {
|
|
it('下载接口必须保留请求签名、硬件指纹和模块包生成校验', () => {
|
|
const source = fs.readFileSync(downloadRoutePath, 'utf8');
|
|
|
|
expect(source).toContain("verifyLicenseRequestSignature('premium-module-download'");
|
|
expect(source).toContain('calculateFingerprintMatchScore');
|
|
expect(source).toContain("license.licenseType === 'FREE'");
|
|
expect(source).toContain('buildPremiumModulePackage');
|
|
});
|
|
});
|