Skip to content

Commit

Permalink
Fix tests and add link back to dev deps
Browse files Browse the repository at this point in the history
  • Loading branch information
willosborne committed Jan 3, 2025
1 parent ba29175 commit 4f574d9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
6 changes: 4 additions & 2 deletions cli/test_fixtures/validate_output_junit.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="23" failures="0" errors="0" skipped="0">
<testsuites tests="25" failures="0" errors="0" skipped="0">
<testsuite name="JSON Schema Validation" tests="1" failures="0"
errors="0" skipped="0">
<testcase name="JSON Schema Validation succeeded" />
</testsuite>
<testsuite name="Spectral Suite" tests="22"
<testsuite name="Spectral Suite" tests="24"
failures="0" errors="0" skipped="0">
<testcase name="architecture-has-nodes-relationships" />
<testcase name="architecture-has-no-empty-properties" />
Expand All @@ -16,6 +16,7 @@
<testcase
name="connects-relationship-references-existing-nodes-in-architecture" />
<testcase name="referenced-interfaces-defined-in-architecture" />
<testcase name="referenced-interfaces-defined-on-correct-node-in-architecture" />
<testcase name="composition-relationships-reference-existing-nodes-in-architecture" />
<testcase name="architecture-nodes-must-be-referenced" />
<testcase
Expand All @@ -31,6 +32,7 @@
<testcase
name="relationship-references-existing-nodes-in-pattern" />
<testcase name="referenced-interfaces-defined-in-pattern" />
<testcase name="referenced-interfaces-defined-on-correct-node-in-pattern" />
<testcase name="pattern-nodes-must-be-referenced" />
<testcase name="unique-ids-must-be-unique-in-pattern" />
</testsuite>
Expand Down
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"link:cli": "npm link --workspace cli"
},
"devDependencies": {
"link": "^2.1.1",
"npm-run-all2": "^5.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function interfaceIdExistsOnNode(input, _, context) {
}

const nodeId = input.node;
console.log('id: ', nodeId);
const nodeMatch: object[] = JSONPath({ path: `$.nodes[?(@['unique-id'] == '${nodeId}')]`, json: context.document.data });
if (!nodeMatch || nodeMatch.length === 0) {
// other rule will report undefined node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function interfaceIdExistsOnNode(input, _, context) {
}

const nodeId = input.node;
console.log('id: ', nodeId);
const nodeMatch: object[] = JSONPath({ path: `$.properties.nodes.prefixItems[?(@.properties['unique-id'].const == '${nodeId}')]`, json: context.document.data });
if (!nodeMatch || nodeMatch.length === 0) {
// other rule will report undefined node
Expand Down
2 changes: 1 addition & 1 deletion shared/src/spectral/rules-pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const patternRules: RulesetDefinition = {
function: interfaceIdExists,
},
},
'referenced-interfaces-defined-on-correct-node-in-architecture': {
'referenced-interfaces-defined-on-correct-node-in-pattern': {
description: 'Connects relationships must reference interfaces that exist on the correct nodes',
severity: 'error',
message: '{{error}}',
Expand Down

0 comments on commit 4f574d9

Please sign in to comment.