@ adobe/ 数据测试
合规测试公用事业 @adobe/data ECS的特点: Match 财务报告和审定财务报表
Conformance spec QQ ECS 兼容模式后面的命名空间( 请参见
@adobe/data-ai是因为 features/spec/index.md 财务报告和审定财务报表 features/ecs/conformance.md) (中文(简体) ).
此软件包与 @adobe/data 从而安装
@adobe/data 从来没有拉入一个 vitest 同伴依赖——只有项目
实际作者符合性测试(因此已经取决于 vitest(中文(简体) )
需要这个.
安装
pnpm add -D @adobe/data-testing vitest
使用量
// spec/spec.ts — the pure spec: State, its actions and derivations, their cases
export const spec = Conformance.spec({
state: State,
fns: transforms,
schemas: { ...components, ...resources },
services: { analytics: AnalyticsService.createFake },
cases: { createTodo, toggleComplete, visibleTodos },
});
// spec/spec.test.ts
Conformance.checkSpec(spec);
// ecs/conformance/implementation.ts — the spec paired with its ECS build
export const implementation = Conformance.implementation(spec, {
plugin: MainService.plugin,
computedPlugin: ComputedDatabase.plugin,
projection,
hydrate: ["visibleTodos"],
});
// ecs/conformance/conformance.test.ts
Conformance.checkFeature(implementation);
-
checkSpec运行与纯光谱函数相对的每个案件。 没有建立ECS. -
checkFeature审理每一个针对ECS的案件:- 针对同名动作的每个动作;
- 依其计算而得的;
- 每个ECS系统与同名的 spec 系统函数相对应,运行的只是 系统;
- 按系统顺序运行每个模拟系统
schedule声明frame选项列出参数写器和未建模的系统.
也是往返
State.samples通过投影。 一个没有的 Spec 操作 执行失败. -
Conformance.StateMatches<State, typeof resources, typeof components>针头 aState特性的资源和组件名称的密钥 . -
Match提供宽容、对等和对等的比较matches, (中文(简体) ),ref, (中文(简体) ),anyNumber, (中文(简体) ),anyString) (中文(简体) ). -
读取环境上下文的动作( 对等
userId(通过测试)concurrency(单位:千美元)seedContext改为Conformance.implementation。 。 。 . -
下级跑者
runActions, (中文(简体) ),runComputeds, (中文(简体) ),runSystems, (中文(简体) ),runTransactions, (中文(简体) ),adaptCases留作自带用.