27 lines
726 B
TypeScript
27 lines
726 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('buildPremiumModuleEntitlement');
|
|
});
|
|
});
|