@transitrix/diagrams 1.8.6 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/fgca/index.js +10 -10
  2. package/dist/fgca/layout.js +1 -1
  3. package/dist/fgca/nodeTypes.js +4 -4
  4. package/dist/index.js +33 -33
  5. package/package.json +8 -2
  6. package/dist/__tests__/edge-path.test.d.ts +0 -1
  7. package/dist/__tests__/edge-path.test.js +0 -55
  8. package/dist/__tests__/node-size-presets.test.d.ts +0 -1
  9. package/dist/__tests__/node-size-presets.test.js +0 -30
  10. package/dist/__tests__/scope.test.d.ts +0 -1
  11. package/dist/__tests__/scope.test.js +0 -23
  12. package/dist/__tests__/yaml-normalize.test.d.ts +0 -1
  13. package/dist/__tests__/yaml-normalize.test.js +0 -148
  14. package/dist/activities/__tests__/cpm.test.d.ts +0 -1
  15. package/dist/activities/__tests__/cpm.test.js +0 -146
  16. package/dist/activities/__tests__/gantt.test.d.ts +0 -1
  17. package/dist/activities/__tests__/gantt.test.js +0 -263
  18. package/dist/activities/__tests__/layout.test.d.ts +0 -1
  19. package/dist/activities/__tests__/layout.test.js +0 -98
  20. package/dist/activities/__tests__/validate.test.d.ts +0 -1
  21. package/dist/activities/__tests__/validate.test.js +0 -397
  22. package/dist/activity-card/__tests__/example.test.d.ts +0 -1
  23. package/dist/activity-card/__tests__/example.test.js +0 -73
  24. package/dist/activity-card/__tests__/layout.test.d.ts +0 -1
  25. package/dist/activity-card/__tests__/layout.test.js +0 -141
  26. package/dist/activity-card/__tests__/resolver.test.d.ts +0 -1
  27. package/dist/activity-card/__tests__/resolver.test.js +0 -325
  28. package/dist/activity-card/__tests__/validate.test.d.ts +0 -1
  29. package/dist/activity-card/__tests__/validate.test.js +0 -149
  30. package/dist/actor/__tests__/validate.test.d.ts +0 -1
  31. package/dist/actor/__tests__/validate.test.js +0 -95
  32. package/dist/applications/__tests__/validate.test.d.ts +0 -1
  33. package/dist/applications/__tests__/validate.test.js +0 -223
  34. package/dist/assertion/__tests__/example.test.d.ts +0 -1
  35. package/dist/assertion/__tests__/example.test.js +0 -32
  36. package/dist/assertion/__tests__/validate.test.d.ts +0 -1
  37. package/dist/assertion/__tests__/validate.test.js +0 -130
  38. package/dist/blocks/__tests__/layout.test.d.ts +0 -1
  39. package/dist/blocks/__tests__/layout.test.js +0 -153
  40. package/dist/blocks/__tests__/validate.test.d.ts +0 -1
  41. package/dist/blocks/__tests__/validate.test.js +0 -235
  42. package/dist/business-service/__tests__/validate.test.d.ts +0 -1
  43. package/dist/business-service/__tests__/validate.test.js +0 -135
  44. package/dist/capability-map/__tests__/CapabilityMapView.test.d.ts +0 -1
  45. package/dist/capability-map/__tests__/CapabilityMapView.test.js +0 -217
  46. package/dist/capability-map/__tests__/address.test.d.ts +0 -1
  47. package/dist/capability-map/__tests__/address.test.js +0 -49
  48. package/dist/capability-map/__tests__/dsm-layout.test.d.ts +0 -1
  49. package/dist/capability-map/__tests__/dsm-layout.test.js +0 -46
  50. package/dist/capability-map/__tests__/dsm-mutations.test.d.ts +0 -1
  51. package/dist/capability-map/__tests__/dsm-mutations.test.js +0 -125
  52. package/dist/capability-map/__tests__/dsm-validate.test.d.ts +0 -1
  53. package/dist/capability-map/__tests__/dsm-validate.test.js +0 -56
  54. package/dist/capability-map/__tests__/validate.test.d.ts +0 -1
  55. package/dist/capability-map/__tests__/validate.test.js +0 -212
  56. package/dist/change/__tests__/validate.test.d.ts +0 -1
  57. package/dist/change/__tests__/validate.test.js +0 -79
  58. package/dist/codex/__tests__/example.test.d.ts +0 -1
  59. package/dist/codex/__tests__/example.test.js +0 -33
  60. package/dist/codex/__tests__/validate.test.d.ts +0 -1
  61. package/dist/codex/__tests__/validate.test.js +0 -68
  62. package/dist/compliance/__tests__/canon-catalog.test.d.ts +0 -1
  63. package/dist/compliance/__tests__/canon-catalog.test.js +0 -60
  64. package/dist/compliance/__tests__/classify.test.d.ts +0 -1
  65. package/dist/compliance/__tests__/classify.test.js +0 -58
  66. package/dist/compliance/__tests__/confidence.test.d.ts +0 -1
  67. package/dist/compliance/__tests__/confidence.test.js +0 -78
  68. package/dist/compliance/__tests__/coverage-metric.test.d.ts +0 -1
  69. package/dist/compliance/__tests__/coverage-metric.test.js +0 -264
  70. package/dist/compliance/__tests__/demo-scenario.test.d.ts +0 -1
  71. package/dist/compliance/__tests__/demo-scenario.test.js +0 -226
  72. package/dist/compliance/__tests__/example.test.d.ts +0 -1
  73. package/dist/compliance/__tests__/example.test.js +0 -51
  74. package/dist/compliance/__tests__/gap-report.test.d.ts +0 -1
  75. package/dist/compliance/__tests__/gap-report.test.js +0 -113
  76. package/dist/compliance/__tests__/html.test.d.ts +0 -1
  77. package/dist/compliance/__tests__/html.test.js +0 -122
  78. package/dist/compliance/__tests__/impact.test.d.ts +0 -1
  79. package/dist/compliance/__tests__/impact.test.js +0 -913
  80. package/dist/compliance/__tests__/markdown.test.d.ts +0 -1
  81. package/dist/compliance/__tests__/markdown.test.js +0 -85
  82. package/dist/compliance/__tests__/trace.test.d.ts +0 -1
  83. package/dist/compliance/__tests__/trace.test.js +0 -144
  84. package/dist/compliance/__tests__/view-resolution.test.d.ts +0 -1
  85. package/dist/compliance/__tests__/view-resolution.test.js +0 -59
  86. package/dist/compliance/__tests__/views.test.d.ts +0 -1
  87. package/dist/compliance/__tests__/views.test.js +0 -59
  88. package/dist/compliance-matrix/__tests__/build.test.d.ts +0 -1
  89. package/dist/compliance-matrix/__tests__/build.test.js +0 -183
  90. package/dist/compliance-matrix/__tests__/example.test.d.ts +0 -1
  91. package/dist/compliance-matrix/__tests__/example.test.js +0 -49
  92. package/dist/confidence/__tests__/score.test.d.ts +0 -1
  93. package/dist/confidence/__tests__/score.test.js +0 -188
  94. package/dist/constraint/__tests__/example.test.d.ts +0 -1
  95. package/dist/constraint/__tests__/example.test.js +0 -14
  96. package/dist/constraint/__tests__/validate.test.d.ts +0 -1
  97. package/dist/constraint/__tests__/validate.test.js +0 -58
  98. package/dist/factor/__tests__/validate.test.d.ts +0 -1
  99. package/dist/factor/__tests__/validate.test.js +0 -112
  100. package/dist/fgca/__tests__/chain-table.test.d.ts +0 -1
  101. package/dist/fgca/__tests__/chain-table.test.js +0 -158
  102. package/dist/fgca/__tests__/layout.test.d.ts +0 -1
  103. package/dist/fgca/__tests__/layout.test.js +0 -140
  104. package/dist/fgca/__tests__/parse-canonical.test.d.ts +0 -1
  105. package/dist/fgca/__tests__/parse-canonical.test.js +0 -268
  106. package/dist/fgca/__tests__/preview-layout.test.d.ts +0 -1
  107. package/dist/fgca/__tests__/preview-layout.test.js +0 -106
  108. package/dist/fgca/__tests__/resolver.test.d.ts +0 -1
  109. package/dist/fgca/__tests__/resolver.test.js +0 -185
  110. package/dist/fgca/__tests__/validate.test.d.ts +0 -1
  111. package/dist/fgca/__tests__/validate.test.js +0 -125
  112. package/dist/goals/__tests__/GoalTreeView.test.d.ts +0 -1
  113. package/dist/goals/__tests__/GoalTreeView.test.js +0 -337
  114. package/dist/goals/__tests__/layout.test.d.ts +0 -1
  115. package/dist/goals/__tests__/layout.test.js +0 -153
  116. package/dist/goals/__tests__/mutations.test.d.ts +0 -1
  117. package/dist/goals/__tests__/mutations.test.js +0 -134
  118. package/dist/goals/__tests__/parse-canonical.test.d.ts +0 -1
  119. package/dist/goals/__tests__/parse-canonical.test.js +0 -131
  120. package/dist/goals/__tests__/validate.test.d.ts +0 -1
  121. package/dist/goals/__tests__/validate.test.js +0 -183
  122. package/dist/integration/__tests__/validate.test.d.ts +0 -1
  123. package/dist/integration/__tests__/validate.test.js +0 -169
  124. package/dist/location/__tests__/validate.test.d.ts +0 -1
  125. package/dist/location/__tests__/validate.test.js +0 -107
  126. package/dist/node/__tests__/validate.test.d.ts +0 -1
  127. package/dist/node/__tests__/validate.test.js +0 -100
  128. package/dist/process-blueprint/__tests__/compliance-lane.test.d.ts +0 -1
  129. package/dist/process-blueprint/__tests__/compliance-lane.test.js +0 -272
  130. package/dist/process-blueprint/__tests__/layout.test.d.ts +0 -1
  131. package/dist/process-blueprint/__tests__/layout.test.js +0 -196
  132. package/dist/process-blueprint/__tests__/validate.test.d.ts +0 -1
  133. package/dist/process-blueprint/__tests__/validate.test.js +0 -280
  134. package/dist/process-map/__tests__/validate.test.d.ts +0 -1
  135. package/dist/process-map/__tests__/validate.test.js +0 -199
  136. package/dist/products/__tests__/validate.test.d.ts +0 -1
  137. package/dist/products/__tests__/validate.test.js +0 -210
  138. package/dist/repo-validate/__tests__/validate-repo.test.d.ts +0 -1
  139. package/dist/repo-validate/__tests__/validate-repo.test.js +0 -576
  140. package/dist/requirement/__tests__/example.test.d.ts +0 -1
  141. package/dist/requirement/__tests__/example.test.js +0 -21
  142. package/dist/requirement/__tests__/validate.test.d.ts +0 -1
  143. package/dist/requirement/__tests__/validate.test.js +0 -80
  144. package/dist/scenarios/__tests__/validate.test.d.ts +0 -1
  145. package/dist/scenarios/__tests__/validate.test.js +0 -183
  146. package/dist/stakeholder/__tests__/validate.test.d.ts +0 -1
  147. package/dist/stakeholder/__tests__/validate.test.js +0 -88
  148. package/dist/target-state/__tests__/validate.test.d.ts +0 -1
  149. package/dist/target-state/__tests__/validate.test.js +0 -78
  150. package/dist/technology-service/__tests__/validate.test.d.ts +0 -1
  151. package/dist/technology-service/__tests__/validate.test.js +0 -121
  152. package/dist/theme/__tests__/tokens.test.d.ts +0 -1
  153. package/dist/theme/__tests__/tokens.test.js +0 -159
  154. package/dist/webview/__tests__/entity-text-layout.test.d.ts +0 -1
  155. package/dist/webview/__tests__/entity-text-layout.test.js +0 -155
  156. package/dist/webview/__tests__/entry-notations.test.d.ts +0 -1
  157. package/dist/webview/__tests__/entry-notations.test.js +0 -62
  158. package/dist/webview/__tests__/entry.test.d.ts +0 -1
  159. package/dist/webview/__tests__/entry.test.js +0 -56
  160. package/dist/webview/__tests__/render-activities.test.d.ts +0 -1
  161. package/dist/webview/__tests__/render-activities.test.js +0 -91
  162. package/dist/webview/__tests__/render-blocks.test.d.ts +0 -1
  163. package/dist/webview/__tests__/render-blocks.test.js +0 -175
  164. package/dist/webview/__tests__/render-goals.test.d.ts +0 -1
  165. package/dist/webview/__tests__/render-goals.test.js +0 -120
  166. package/dist/webview/__tests__/render-process.test.d.ts +0 -1
  167. package/dist/webview/__tests__/render-process.test.js +0 -463
  168. package/dist/webview/__tests__/render-util.test.d.ts +0 -1
  169. package/dist/webview/__tests__/render-util.test.js +0 -54
  170. package/src/__tests__/edge-path.test.ts +0 -67
  171. package/src/__tests__/node-size-presets.test.ts +0 -50
  172. package/src/__tests__/scope.test.ts +0 -27
  173. package/src/__tests__/yaml-normalize.test.ts +0 -158
  174. package/src/activities/__tests__/cpm.test.ts +0 -164
  175. package/src/activities/__tests__/gantt.test.ts +0 -290
  176. package/src/activities/__tests__/layout.test.ts +0 -112
  177. package/src/activities/__tests__/validate.test.ts +0 -446
  178. package/src/activity-card/__tests__/example.test.ts +0 -83
  179. package/src/activity-card/__tests__/layout.test.ts +0 -162
  180. package/src/activity-card/__tests__/resolver.test.ts +0 -357
  181. package/src/activity-card/__tests__/validate.test.ts +0 -167
  182. package/src/actor/__tests__/validate.test.ts +0 -114
  183. package/src/applications/__tests__/validate.test.ts +0 -256
  184. package/src/assertion/__tests__/example.test.ts +0 -37
  185. package/src/assertion/__tests__/validate.test.ts +0 -142
  186. package/src/blocks/__tests__/layout.test.ts +0 -169
  187. package/src/blocks/__tests__/validate.test.ts +0 -260
  188. package/src/business-service/__tests__/validate.test.ts +0 -160
  189. package/src/capability-map/__tests__/CapabilityMapView.test.tsx +0 -232
  190. package/src/capability-map/__tests__/address.test.ts +0 -59
  191. package/src/capability-map/__tests__/dsm-layout.test.ts +0 -52
  192. package/src/capability-map/__tests__/dsm-mutations.test.ts +0 -141
  193. package/src/capability-map/__tests__/dsm-validate.test.ts +0 -65
  194. package/src/capability-map/__tests__/validate.test.ts +0 -238
  195. package/src/change/__tests__/validate.test.ts +0 -97
  196. package/src/codex/__tests__/example.test.ts +0 -40
  197. package/src/codex/__tests__/validate.test.ts +0 -84
  198. package/src/compliance/__tests__/canon-catalog.test.ts +0 -68
  199. package/src/compliance/__tests__/classify.test.ts +0 -64
  200. package/src/compliance/__tests__/confidence.test.ts +0 -98
  201. package/src/compliance/__tests__/coverage-metric.test.ts +0 -300
  202. package/src/compliance/__tests__/demo-scenario.test.ts +0 -273
  203. package/src/compliance/__tests__/example.test.ts +0 -57
  204. package/src/compliance/__tests__/gap-report.test.ts +0 -129
  205. package/src/compliance/__tests__/html.test.ts +0 -142
  206. package/src/compliance/__tests__/impact.test.ts +0 -1060
  207. package/src/compliance/__tests__/markdown.test.ts +0 -95
  208. package/src/compliance/__tests__/trace.test.ts +0 -157
  209. package/src/compliance/__tests__/view-resolution.test.ts +0 -80
  210. package/src/compliance/__tests__/views.test.ts +0 -64
  211. package/src/compliance-matrix/__tests__/build.test.ts +0 -200
  212. package/src/compliance-matrix/__tests__/example.test.ts +0 -57
  213. package/src/confidence/__tests__/score.test.ts +0 -254
  214. package/src/constraint/__tests__/example.test.ts +0 -19
  215. package/src/constraint/__tests__/validate.test.ts +0 -68
  216. package/src/factor/__tests__/validate.test.ts +0 -133
  217. package/src/fgca/__tests__/chain-table.test.ts +0 -172
  218. package/src/fgca/__tests__/layout.test.ts +0 -179
  219. package/src/fgca/__tests__/parse-canonical.test.ts +0 -296
  220. package/src/fgca/__tests__/preview-layout.test.ts +0 -124
  221. package/src/fgca/__tests__/resolver.test.ts +0 -209
  222. package/src/fgca/__tests__/validate.test.ts +0 -142
  223. package/src/goals/__tests__/GoalTreeView.test.tsx +0 -361
  224. package/src/goals/__tests__/layout.test.ts +0 -175
  225. package/src/goals/__tests__/mutations.test.ts +0 -153
  226. package/src/goals/__tests__/parse-canonical.test.ts +0 -147
  227. package/src/goals/__tests__/validate.test.ts +0 -202
  228. package/src/integration/__tests__/validate.test.ts +0 -203
  229. package/src/location/__tests__/validate.test.ts +0 -127
  230. package/src/node/__tests__/validate.test.ts +0 -118
  231. package/src/process-blueprint/__tests__/compliance-lane.test.ts +0 -320
  232. package/src/process-blueprint/__tests__/layout.test.ts +0 -240
  233. package/src/process-blueprint/__tests__/validate.test.ts +0 -310
  234. package/src/process-map/__tests__/validate.test.ts +0 -223
  235. package/src/products/__tests__/validate.test.ts +0 -239
  236. package/src/repo-validate/__tests__/validate-repo.test.ts +0 -699
  237. package/src/requirement/__tests__/example.test.ts +0 -24
  238. package/src/requirement/__tests__/validate.test.ts +0 -96
  239. package/src/scenarios/__tests__/validate.test.ts +0 -209
  240. package/src/stakeholder/__tests__/validate.test.ts +0 -105
  241. package/src/target-state/__tests__/validate.test.ts +0 -95
  242. package/src/technology-service/__tests__/validate.test.ts +0 -143
  243. package/src/theme/__tests__/tokens.test.ts +0 -185
  244. package/src/webview/__tests__/entity-text-layout.test.ts +0 -182
  245. package/src/webview/__tests__/entry-notations.test.ts +0 -77
  246. package/src/webview/__tests__/entry.test.ts +0 -64
  247. package/src/webview/__tests__/render-activities.test.ts +0 -100
  248. package/src/webview/__tests__/render-blocks.test.ts +0 -206
  249. package/src/webview/__tests__/render-goals.test.ts +0 -128
  250. package/src/webview/__tests__/render-process.test.ts +0 -538
  251. package/src/webview/__tests__/render-util.test.ts +0 -66
@@ -1,576 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { validateRepoModel } from '../validate-repo.js';
3
- function el(path, data, parseError) {
4
- return { path, data, parseError };
5
- }
6
- /** A small clean model mirroring the acme_corp shape: relations use `from`/`to`
7
- * and every endpoint resolves to an element. Should produce zero findings —
8
- * the parity bar against lint.py on the worked example. */
9
- function cleanModel() {
10
- return {
11
- elements: [
12
- el('canon/elements/01_motivation/goals/GOAL-OPS-1.yaml', { notation: 'goal', id: 'GOAL-OPS-1' }),
13
- el('canon/elements/01_motivation/assessments/ASSESSMENT-1.yaml', { notation: 'assessment', id: 'ASSESSMENT-1' }),
14
- el('canon/elements/02_business/capabilities/CAPABILITY-V1.yaml', { notation: 'capability', id: 'CAPABILITY-V1' }),
15
- // sidecar with no `id` — must be ignored (no duplicate, not an element)
16
- el('canon/elements/02_business/capabilities/CAPABILITY-V1.history.yaml', { target: 'CAPABILITY-V1', attribute_versions: [] }),
17
- ],
18
- relations: [
19
- el('canon/relations/REL-1.yaml', { notation: 'relation', id: 'REL-1', from: 'ASSESSMENT-1', to: 'GOAL-OPS-1' }),
20
- ],
21
- };
22
- }
23
- describe('validateRepoModel — parity / clean tree', () => {
24
- it('produces zero findings on a clean model (acme_corp parity)', () => {
25
- expect(validateRepoModel(cleanModel())).toEqual([]);
26
- });
27
- it('ignores sidecar docs without an id (no false duplicate)', () => {
28
- const findings = validateRepoModel(cleanModel());
29
- expect(findings.filter((f) => f.message.includes('Duplicate'))).toEqual([]);
30
- });
31
- it('every finding carries the frozen { scope, id, message } shape', () => {
32
- const model = cleanModel();
33
- model.relations.push(el('canon/relations/REL-BAD.yaml', { notation: 'relation', id: 'REL-BAD', from: 'NOPE', to: 'GOAL-OPS-1' }));
34
- const findings = validateRepoModel(model);
35
- expect(findings.length).toBeGreaterThan(0);
36
- for (const f of findings) {
37
- expect(Object.keys(f).sort()).toEqual(['id', 'message', 'scope']);
38
- expect(f.scope).toBe('repo');
39
- }
40
- });
41
- });
42
- describe('validateRepoModel — referential integrity', () => {
43
- it('flags a relation whose `from` endpoint is unknown', () => {
44
- const model = cleanModel();
45
- model.relations = [el('canon/relations/REL-X.yaml', { notation: 'relation', id: 'REL-X', from: 'MISSING-1', to: 'GOAL-OPS-1' })];
46
- const findings = validateRepoModel(model);
47
- expect(findings).toHaveLength(1);
48
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-X' });
49
- expect(findings[0].message).toContain('MISSING-1');
50
- expect(findings[0].message).toContain('(from)');
51
- });
52
- it('flags a relation whose `to` endpoint is unknown', () => {
53
- const model = cleanModel();
54
- model.relations = [el('canon/relations/REL-Y.yaml', { notation: 'relation', id: 'REL-Y', from: 'GOAL-OPS-1', to: 'MISSING-2' })];
55
- const findings = validateRepoModel(model);
56
- expect(findings).toHaveLength(1);
57
- expect(findings[0].message).toContain('(to)');
58
- });
59
- it('accepts lint.py-style `source`/`target` endpoint keys', () => {
60
- const model = cleanModel();
61
- model.relations = [el('canon/relations/REL-ST.yaml', { id: 'REL-ST', source: 'ASSESSMENT-1', target: 'GOAL-OPS-1' })];
62
- expect(validateRepoModel(model)).toEqual([]);
63
- });
64
- it('resolves `{ id }` object endpoints', () => {
65
- const model = cleanModel();
66
- model.relations = [el('canon/relations/REL-OBJ.yaml', { id: 'REL-OBJ', from: { id: 'ASSESSMENT-1' }, to: { id: 'GOAL-OPS-1' } })];
67
- expect(validateRepoModel(model)).toEqual([]);
68
- });
69
- });
70
- describe('validateRepoModel — atomicity', () => {
71
- it('flags an element file that contains an inline `relations` section', () => {
72
- const model = cleanModel();
73
- model.elements.push(el('canon/elements/02_business/E.yaml', { id: 'ELEMENT-1', relations: [{ to: 'GOAL-OPS-1' }] }));
74
- const findings = validateRepoModel(model);
75
- expect(findings).toHaveLength(1);
76
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'ELEMENT-1' });
77
- expect(findings[0].message).toContain('Atomicity');
78
- });
79
- });
80
- describe('validateRepoModel — id uniqueness', () => {
81
- it('flags the same id defined in two files', () => {
82
- const model = cleanModel();
83
- model.elements.push(el('canon/elements/dupe-a.yaml', { id: 'DUP-1' }));
84
- model.elements.push(el('canon/elements/dupe-b.yaml', { id: 'DUP-1' }));
85
- const findings = validateRepoModel(model);
86
- expect(findings).toHaveLength(1);
87
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'DUP-1' });
88
- expect(findings[0].message).toContain('dupe-a.yaml');
89
- expect(findings[0].message).toContain('dupe-b.yaml');
90
- });
91
- it('flags an element/relation id collision across zones', () => {
92
- const model = cleanModel();
93
- model.elements.push(el('canon/elements/clash.yaml', { id: 'CLASH-1' }));
94
- model.relations.push(el('canon/relations/clash.yaml', { id: 'CLASH-1', from: 'GOAL-OPS-1', to: 'ASSESSMENT-1' }));
95
- const findings = validateRepoModel(model);
96
- expect(findings.filter((f) => f.id === 'CLASH-1')).toHaveLength(1);
97
- });
98
- });
99
- describe('validateRepoModel — policy', () => {
100
- it('flags an Active element with no owner', () => {
101
- const model = cleanModel();
102
- model.elements.push(el('canon/elements/svc.yaml', { id: 'SVC-1', metadata: { status: 'Active' } }));
103
- const findings = validateRepoModel(model);
104
- expect(findings).toHaveLength(1);
105
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'SVC-1' });
106
- expect(findings[0].message).toContain('Policy');
107
- });
108
- it('does not flag an Active element that has an owner', () => {
109
- const model = cleanModel();
110
- model.elements.push(el('canon/elements/svc.yaml', { id: 'SVC-2', metadata: { status: 'Active', owner: 'team-a' } }));
111
- expect(validateRepoModel(model)).toEqual([]);
112
- });
113
- it('does not flag elements using the canon admission record (no metadata.status)', () => {
114
- // acme_corp elements use `zone`/`admitted_by`, not `metadata.status` — must not fire.
115
- const model = cleanModel();
116
- model.elements.push(el('canon/elements/g.yaml', { id: 'GOAL-X', zone: 'canon', admitted_by: 'v.korobeinikov' }));
117
- expect(validateRepoModel(model)).toEqual([]);
118
- });
119
- });
120
- describe('validateRepoModel — syntax', () => {
121
- it('reports a parse error and skips graph checks', () => {
122
- const model = cleanModel();
123
- model.elements.push(el('canon/elements/broken.yaml', null, 'bad indentation'));
124
- // also add a dangling relation that would otherwise fire — it must be suppressed
125
- model.relations.push(el('canon/relations/REL-Z.yaml', { id: 'REL-Z', from: 'MISSING', to: 'GOAL-OPS-1' }));
126
- const findings = validateRepoModel(model);
127
- expect(findings).toHaveLength(1);
128
- expect(findings[0]).toMatchObject({ scope: 'repo', id: '' });
129
- expect(findings[0].message).toContain('YAML syntax error');
130
- expect(findings[0].message).toContain('broken.yaml');
131
- });
132
- });
133
- describe('validateRepoModel — layer-semantics (unit_located_at / located_at)', () => {
134
- function locationModel() {
135
- const model = cleanModel();
136
- model.elements.push(el('canon/elements/02_business/actors/ACTOR-OPS-1.yaml', {
137
- notation: 'actor',
138
- id: 'ACTOR-OPS-1',
139
- type: 'business_unit',
140
- }), el('canon/elements/02_business/actors/ACTOR-JANE-1.yaml', {
141
- notation: 'actor',
142
- id: 'ACTOR-JANE-1',
143
- type: 'person',
144
- }), el('canon/elements/02_business/locations/LOCATION-TBILISI-1.yaml', {
145
- notation: 'location',
146
- id: 'LOCATION-TBILISI-1',
147
- }));
148
- return model;
149
- }
150
- it('accepts a valid unit_located_at (business_unit → LOCATION)', () => {
151
- const model = locationModel();
152
- model.relations.push(el('canon/relations/REL-LOC-1.yaml', {
153
- notation: 'relation',
154
- id: 'REL-LOC-1',
155
- type: 'unit_located_at',
156
- from: 'ACTOR-OPS-1',
157
- to: 'LOCATION-TBILISI-1',
158
- }));
159
- expect(validateRepoModel(model)).toEqual([]);
160
- });
161
- it('accepts a valid located_at for a business_unit', () => {
162
- const model = locationModel();
163
- model.relations.push(el('canon/relations/REL-LOC-2.yaml', {
164
- notation: 'relation',
165
- id: 'REL-LOC-2',
166
- type: 'located_at',
167
- from: 'ACTOR-OPS-1',
168
- to: 'LOCATION-TBILISI-1',
169
- }));
170
- expect(validateRepoModel(model)).toEqual([]);
171
- });
172
- it('accepts a valid located_at for a person', () => {
173
- const model = locationModel();
174
- model.relations.push(el('canon/relations/REL-LOC-3.yaml', {
175
- notation: 'relation',
176
- id: 'REL-LOC-3',
177
- type: 'located_at',
178
- from: 'ACTOR-JANE-1',
179
- to: 'LOCATION-TBILISI-1',
180
- }));
181
- expect(validateRepoModel(model)).toEqual([]);
182
- });
183
- it('flags unit_located_at with a wrong from type (person instead of business_unit)', () => {
184
- const model = locationModel();
185
- model.relations.push(el('canon/relations/REL-BAD-1.yaml', {
186
- notation: 'relation',
187
- id: 'REL-BAD-1',
188
- type: 'unit_located_at',
189
- from: 'ACTOR-JANE-1',
190
- to: 'LOCATION-TBILISI-1',
191
- }));
192
- const findings = validateRepoModel(model);
193
- expect(findings).toHaveLength(1);
194
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-BAD-1' });
195
- expect(findings[0].message).toContain('unit_located_at');
196
- expect(findings[0].message).toContain('business_unit');
197
- });
198
- it('flags unit_located_at with a non-ACTOR from element', () => {
199
- const model = locationModel();
200
- model.relations.push(el('canon/relations/REL-BAD-2.yaml', {
201
- notation: 'relation',
202
- id: 'REL-BAD-2',
203
- type: 'unit_located_at',
204
- from: 'GOAL-OPS-1',
205
- to: 'LOCATION-TBILISI-1',
206
- }));
207
- const findings = validateRepoModel(model);
208
- expect(findings).toHaveLength(1);
209
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-BAD-2' });
210
- expect(findings[0].message).toContain('unit_located_at');
211
- });
212
- it('flags unit_located_at with a non-LOCATION to element', () => {
213
- const model = locationModel();
214
- model.relations.push(el('canon/relations/REL-BAD-3.yaml', {
215
- notation: 'relation',
216
- id: 'REL-BAD-3',
217
- type: 'unit_located_at',
218
- from: 'ACTOR-OPS-1',
219
- to: 'GOAL-OPS-1',
220
- }));
221
- const findings = validateRepoModel(model);
222
- expect(findings).toHaveLength(1);
223
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-BAD-3' });
224
- expect(findings[0].message).toContain('LOCATION');
225
- });
226
- it('flags located_at with a non-actor from element', () => {
227
- const model = locationModel();
228
- model.relations.push(el('canon/relations/REL-BAD-4.yaml', {
229
- notation: 'relation',
230
- id: 'REL-BAD-4',
231
- type: 'located_at',
232
- from: 'CAPABILITY-V1',
233
- to: 'LOCATION-TBILISI-1',
234
- }));
235
- const findings = validateRepoModel(model);
236
- expect(findings).toHaveLength(1);
237
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-BAD-4' });
238
- expect(findings[0].message).toContain('located_at');
239
- });
240
- it('does not emit layer-semantic findings for unknown endpoints (ref-integrity handles those)', () => {
241
- const model = locationModel();
242
- model.relations.push(el('canon/relations/REL-MISSING.yaml', {
243
- notation: 'relation',
244
- id: 'REL-MISSING',
245
- type: 'unit_located_at',
246
- from: 'ACTOR-UNKNOWN-99',
247
- to: 'LOCATION-UNKNOWN-99',
248
- }));
249
- const findings = validateRepoModel(model);
250
- // ref-integrity fires for missing endpoints; no duplicate layer-semantic finding
251
- expect(findings.every((f) => !f.message.includes('Layer-semantics'))).toBe(true);
252
- expect(findings.some((f) => f.message.includes('ACTOR-UNKNOWN-99'))).toBe(true);
253
- });
254
- });
255
- describe('validateRepoModel — layer-semantics (offers / realizes)', () => {
256
- function serviceModel() {
257
- const model = cleanModel();
258
- model.elements.push(el('canon/elements/02_business/actors/ACTOR-OPS-1.yaml', {
259
- notation: 'actor',
260
- id: 'ACTOR-OPS-1',
261
- type: 'business_unit',
262
- }), el('canon/elements/02_business/roles/ROLE-OWNER-1.yaml', {
263
- notation: 'role',
264
- id: 'ROLE-OWNER-1',
265
- }), el('canon/elements/02_business/business-services/BUSINESS_SERVICE-CRM-1.yaml', {
266
- notation: 'business-service',
267
- id: 'BUSINESS_SERVICE-CRM-1',
268
- }), el('canon/elements/02_business/capabilities/CAPABILITY-V2.yaml', {
269
- notation: 'capability',
270
- id: 'CAPABILITY-V2',
271
- }));
272
- return model;
273
- }
274
- it('accepts a valid offers (ACTOR(business_unit) → BUSINESS_SERVICE)', () => {
275
- const model = serviceModel();
276
- model.relations.push(el('canon/relations/REL-SVC-1.yaml', {
277
- notation: 'relation',
278
- id: 'REL-SVC-1',
279
- type: 'offers',
280
- from: 'ACTOR-OPS-1',
281
- to: 'BUSINESS_SERVICE-CRM-1',
282
- }));
283
- expect(validateRepoModel(model)).toEqual([]);
284
- });
285
- it('accepts a valid offers (ROLE → BUSINESS_SERVICE)', () => {
286
- const model = serviceModel();
287
- model.relations.push(el('canon/relations/REL-SVC-2.yaml', {
288
- notation: 'relation',
289
- id: 'REL-SVC-2',
290
- type: 'offers',
291
- from: 'ROLE-OWNER-1',
292
- to: 'BUSINESS_SERVICE-CRM-1',
293
- }));
294
- expect(validateRepoModel(model)).toEqual([]);
295
- });
296
- it('accepts a valid realizes (BUSINESS_SERVICE → CAPABILITY)', () => {
297
- const model = serviceModel();
298
- model.relations.push(el('canon/relations/REL-SVC-3.yaml', {
299
- notation: 'relation',
300
- id: 'REL-SVC-3',
301
- type: 'realizes',
302
- from: 'BUSINESS_SERVICE-CRM-1',
303
- to: 'CAPABILITY-V2',
304
- }));
305
- expect(validateRepoModel(model)).toEqual([]);
306
- });
307
- it('flags offers with a non-ACTOR/non-ROLE from element', () => {
308
- const model = serviceModel();
309
- model.relations.push(el('canon/relations/REL-SVC-BAD-1.yaml', {
310
- notation: 'relation',
311
- id: 'REL-SVC-BAD-1',
312
- type: 'offers',
313
- from: 'CAPABILITY-V2',
314
- to: 'BUSINESS_SERVICE-CRM-1',
315
- }));
316
- const findings = validateRepoModel(model);
317
- expect(findings).toHaveLength(1);
318
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-SVC-BAD-1' });
319
- expect(findings[0].message).toContain('offers');
320
- expect(findings[0].message).toContain('ACTOR');
321
- });
322
- it('flags offers with a non-BUSINESS_SERVICE to element', () => {
323
- const model = serviceModel();
324
- model.relations.push(el('canon/relations/REL-SVC-BAD-2.yaml', {
325
- notation: 'relation',
326
- id: 'REL-SVC-BAD-2',
327
- type: 'offers',
328
- from: 'ACTOR-OPS-1',
329
- to: 'CAPABILITY-V2',
330
- }));
331
- const findings = validateRepoModel(model);
332
- expect(findings).toHaveLength(1);
333
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-SVC-BAD-2' });
334
- expect(findings[0].message).toContain('BUSINESS_SERVICE');
335
- });
336
- it('flags realizes with a non-BUSINESS_SERVICE from element', () => {
337
- const model = serviceModel();
338
- model.relations.push(el('canon/relations/REL-SVC-BAD-3.yaml', {
339
- notation: 'relation',
340
- id: 'REL-SVC-BAD-3',
341
- type: 'realizes',
342
- from: 'ACTOR-OPS-1',
343
- to: 'CAPABILITY-V2',
344
- }));
345
- const findings = validateRepoModel(model);
346
- expect(findings).toHaveLength(1);
347
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-SVC-BAD-3' });
348
- expect(findings[0].message).toContain('realizes');
349
- expect(findings[0].message).toContain('BUSINESS_SERVICE');
350
- });
351
- });
352
- describe('validateRepoModel — layer-semantics (INT-002 integration endpoints)', () => {
353
- function integrationModel() {
354
- const model = cleanModel();
355
- model.elements.push(el('canon/elements/03_application/applications/APPLICATION-OMS-1.yaml', {
356
- notation: 'application',
357
- id: 'APPLICATION-OMS-1',
358
- }), el('canon/elements/03_application/applications/APPLICATION-CRM-1.yaml', {
359
- notation: 'application',
360
- id: 'APPLICATION-CRM-1',
361
- }), el('canon/elements/02_business/actors/ACTOR-OPS-1.yaml', {
362
- notation: 'actor',
363
- id: 'ACTOR-OPS-1',
364
- type: 'business_unit',
365
- }));
366
- return model;
367
- }
368
- it('accepts an interface_semantics integration whose endpoints resolve to APPLICATION elements', () => {
369
- const model = integrationModel();
370
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-OMS-EVENTS-1.yaml', {
371
- notation: 'integration',
372
- id: 'INTEGRATION-OMS-EVENTS-1',
373
- interface_semantics: true,
374
- source: 'APPLICATION-OMS-1',
375
- target: 'APPLICATION-CRM-1',
376
- }));
377
- expect(validateRepoModel(model)).toEqual([]);
378
- });
379
- it('does not fire INT-002 for an integration without interface_semantics', () => {
380
- const model = integrationModel();
381
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-PLAIN-1.yaml', {
382
- notation: 'integration',
383
- id: 'INTEGRATION-PLAIN-1',
384
- source: 'ACTOR-OPS-1',
385
- target: 'APPLICATION-CRM-1',
386
- }));
387
- expect(validateRepoModel(model)).toEqual([]);
388
- });
389
- it('flags INT-002 when source resolves to a non-APPLICATION element', () => {
390
- const model = integrationModel();
391
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-BAD-1.yaml', {
392
- notation: 'integration',
393
- id: 'INTEGRATION-BAD-1',
394
- interface_semantics: true,
395
- source: 'ACTOR-OPS-1',
396
- target: 'APPLICATION-CRM-1',
397
- }));
398
- const findings = validateRepoModel(model);
399
- expect(findings).toHaveLength(1);
400
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'INTEGRATION-BAD-1' });
401
- expect(findings[0].message).toContain('INT-002');
402
- expect(findings[0].message).toContain('ACTOR-OPS-1');
403
- expect(findings[0].message).toContain('source');
404
- });
405
- it('flags INT-002 when target resolves to a non-APPLICATION element', () => {
406
- const model = integrationModel();
407
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-BAD-2.yaml', {
408
- notation: 'integration',
409
- id: 'INTEGRATION-BAD-2',
410
- interface_semantics: true,
411
- source: 'APPLICATION-OMS-1',
412
- target: 'ACTOR-OPS-1',
413
- }));
414
- const findings = validateRepoModel(model);
415
- expect(findings).toHaveLength(1);
416
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'INTEGRATION-BAD-2' });
417
- expect(findings[0].message).toContain('INT-002');
418
- expect(findings[0].message).toContain('ACTOR-OPS-1');
419
- expect(findings[0].message).toContain('target');
420
- });
421
- it('flags INT-002 for both endpoints when neither resolves to APPLICATION', () => {
422
- const model = integrationModel();
423
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-BAD-3.yaml', {
424
- notation: 'integration',
425
- id: 'INTEGRATION-BAD-3',
426
- interface_semantics: true,
427
- source: 'ACTOR-OPS-1',
428
- target: 'GOAL-OPS-1',
429
- }));
430
- const findings = validateRepoModel(model);
431
- expect(findings).toHaveLength(2);
432
- expect(findings.every(f => f.message.includes('INT-002'))).toBe(true);
433
- });
434
- it('does not flag INT-002 when endpoint id is not in the element registry', () => {
435
- // Unresolved IDs are caught by phase 4 (referential integrity), not INT-002.
436
- const model = integrationModel();
437
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-UNRESOLVED-1.yaml', {
438
- notation: 'integration',
439
- id: 'INTEGRATION-UNRESOLVED-1',
440
- interface_semantics: true,
441
- source: 'APPLICATION-MISSING-99',
442
- target: 'APPLICATION-CRM-1',
443
- }));
444
- const findings = validateRepoModel(model).filter(f => f.message.includes('INT-002'));
445
- expect(findings).toHaveLength(0);
446
- });
447
- });
448
- describe('validateRepoModel — layer-semantics (hosts / uses / TSVC-003)', () => {
449
- function techModel() {
450
- const model = cleanModel();
451
- model.elements.push(el('canon/elements/04_technology/nodes/NODE-KAFKA-HOST-1.yaml', {
452
- notation: 'node',
453
- id: 'NODE-KAFKA-HOST-1',
454
- type: 'cloud_instance',
455
- }), el('canon/elements/04_technology/services/TECHNOLOGY_SERVICE-KAFKA-1.yaml', {
456
- notation: 'technology-service',
457
- id: 'TECHNOLOGY_SERVICE-KAFKA-1',
458
- type: 'messaging',
459
- node: 'NODE-KAFKA-HOST-1',
460
- }), el('canon/elements/03_application/applications/APPLICATION-OMS-1.yaml', {
461
- notation: 'application',
462
- id: 'APPLICATION-OMS-1',
463
- }));
464
- return model;
465
- }
466
- it('accepts a valid hosts relation (NODE → TECHNOLOGY_SERVICE)', () => {
467
- const model = techModel();
468
- model.relations.push(el('canon/relations/REL-HOSTS-1.yaml', {
469
- notation: 'relation',
470
- id: 'REL-HOSTS-1',
471
- type: 'hosts',
472
- from: 'NODE-KAFKA-HOST-1',
473
- to: 'TECHNOLOGY_SERVICE-KAFKA-1',
474
- }));
475
- expect(validateRepoModel(model)).toEqual([]);
476
- });
477
- it('accepts a valid uses relation (APPLICATION → TECHNOLOGY_SERVICE)', () => {
478
- const model = techModel();
479
- model.relations.push(el('canon/relations/REL-USES-1.yaml', {
480
- notation: 'relation',
481
- id: 'REL-USES-1',
482
- type: 'uses',
483
- from: 'APPLICATION-OMS-1',
484
- to: 'TECHNOLOGY_SERVICE-KAFKA-1',
485
- }));
486
- expect(validateRepoModel(model)).toEqual([]);
487
- });
488
- it('flags hosts with a non-NODE from element', () => {
489
- const model = techModel();
490
- model.relations.push(el('canon/relations/REL-HOSTS-BAD-1.yaml', {
491
- notation: 'relation',
492
- id: 'REL-HOSTS-BAD-1',
493
- type: 'hosts',
494
- from: 'APPLICATION-OMS-1',
495
- to: 'TECHNOLOGY_SERVICE-KAFKA-1',
496
- }));
497
- const findings = validateRepoModel(model);
498
- expect(findings).toHaveLength(1);
499
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-HOSTS-BAD-1' });
500
- expect(findings[0].message).toContain('hosts');
501
- expect(findings[0].message).toContain('NODE');
502
- });
503
- it('flags hosts with a non-TECHNOLOGY_SERVICE to element', () => {
504
- const model = techModel();
505
- model.relations.push(el('canon/relations/REL-HOSTS-BAD-2.yaml', {
506
- notation: 'relation',
507
- id: 'REL-HOSTS-BAD-2',
508
- type: 'hosts',
509
- from: 'NODE-KAFKA-HOST-1',
510
- to: 'APPLICATION-OMS-1',
511
- }));
512
- const findings = validateRepoModel(model);
513
- expect(findings).toHaveLength(1);
514
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-HOSTS-BAD-2' });
515
- expect(findings[0].message).toContain('hosts');
516
- expect(findings[0].message).toContain('TECHNOLOGY_SERVICE');
517
- });
518
- it('flags uses with a non-APPLICATION from element', () => {
519
- const model = techModel();
520
- model.relations.push(el('canon/relations/REL-USES-BAD-1.yaml', {
521
- notation: 'relation',
522
- id: 'REL-USES-BAD-1',
523
- type: 'uses',
524
- from: 'NODE-KAFKA-HOST-1',
525
- to: 'TECHNOLOGY_SERVICE-KAFKA-1',
526
- }));
527
- const findings = validateRepoModel(model);
528
- expect(findings).toHaveLength(1);
529
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-USES-BAD-1' });
530
- expect(findings[0].message).toContain('uses');
531
- expect(findings[0].message).toContain('APPLICATION');
532
- });
533
- it('flags uses with a non-TECHNOLOGY_SERVICE to element', () => {
534
- const model = techModel();
535
- model.relations.push(el('canon/relations/REL-USES-BAD-2.yaml', {
536
- notation: 'relation',
537
- id: 'REL-USES-BAD-2',
538
- type: 'uses',
539
- from: 'APPLICATION-OMS-1',
540
- to: 'NODE-KAFKA-HOST-1',
541
- }));
542
- const findings = validateRepoModel(model);
543
- expect(findings).toHaveLength(1);
544
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-USES-BAD-2' });
545
- expect(findings[0].message).toContain('uses');
546
- expect(findings[0].message).toContain('TECHNOLOGY_SERVICE');
547
- });
548
- it('TSVC-003: does not flag a technology-service whose node resolves to a NODE element', () => {
549
- const model = techModel();
550
- expect(validateRepoModel(model)).toEqual([]);
551
- });
552
- it('TSVC-003: flags a technology-service whose node resolves to a non-NODE element', () => {
553
- const model = techModel();
554
- model.elements.push(el('canon/elements/04_technology/services/TECHNOLOGY_SERVICE-BAD-1.yaml', {
555
- notation: 'technology-service',
556
- id: 'TECHNOLOGY_SERVICE-BAD-1',
557
- type: 'messaging',
558
- node: 'APPLICATION-OMS-1',
559
- }));
560
- const findings = validateRepoModel(model).filter(f => f.message.includes('TSVC-003'));
561
- expect(findings).toHaveLength(1);
562
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'TECHNOLOGY_SERVICE-BAD-1' });
563
- expect(findings[0].message).toContain('APPLICATION-OMS-1');
564
- });
565
- it('TSVC-003: does not flag a technology-service with an unresolved node (phase 4 handles that)', () => {
566
- const model = techModel();
567
- model.elements.push(el('canon/elements/04_technology/services/TECHNOLOGY_SERVICE-UNRESOLVED-1.yaml', {
568
- notation: 'technology-service',
569
- id: 'TECHNOLOGY_SERVICE-UNRESOLVED-1',
570
- type: 'storage',
571
- node: 'NODE-MISSING-99',
572
- }));
573
- const findings = validateRepoModel(model).filter(f => f.message.includes('TSVC-003'));
574
- expect(findings).toHaveLength(0);
575
- });
576
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- // Conformance test for the shipped REQUIREMENT worked examples — the
2
- // acme_corp canon files mirrored under `tests/fixtures/notation-corpus/requirement/`. Pins the
3
- // success signal of vkgeorgia/strategy#84 Phase 1: the library consumes the
4
- // canonical example files without error.
5
- import { describe, it, expect } from 'vitest';
6
- import { readFileSync } from 'node:fs';
7
- import { fileURLToPath } from 'node:url';
8
- import path from 'node:path';
9
- import yaml from 'js-yaml';
10
- import { validateRequirement } from '../validate.js';
11
- const dir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../../tests/fixtures/notation-corpus/requirement');
12
- const load = (f) => yaml.load(readFileSync(path.join(dir, f), 'utf-8'));
13
- describe('requirement worked examples (acme_corp)', () => {
14
- for (const f of ['REQUIREMENT-DATA-ERASURE-1.yaml', 'REQUIREMENT-AUDIT-LOG-RETENTION-1.yaml']) {
15
- it(`validates ${f} without error`, () => {
16
- const v = validateRequirement(load(f));
17
- expect(v.valid, JSON.stringify(v.errors)).toBe(true);
18
- expect(v.errors).toHaveLength(0);
19
- });
20
- }
21
- });
@@ -1 +0,0 @@
1
- export {};