test: define safe and audit resource rename contract
This commit is contained in:
@@ -1,7 +1,15 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import test from 'node:test';
|
||||
import { auditPlatform, scanInternalIdLeaks } from './audit-check.mjs';
|
||||
|
||||
const resourcesSource = readFileSync('src/api/resources.ts', 'utf8');
|
||||
|
||||
test('资源定义使用 safe 和 audit 前缀', () => {
|
||||
assert.match(resourcesSource, /define\('safe_event', '\/safety\/safe_event'/);
|
||||
assert.match(resourcesSource, /define\('audit_approval', '\/audit\/audit_approval'/);
|
||||
});
|
||||
|
||||
test('只读页面将状态变更视为违规写操作', () => {
|
||||
const failures = auditPlatform({
|
||||
manifest: { resources: [], routes: [] },
|
||||
|
||||
Reference in New Issue
Block a user