Skip to content

Commit

Permalink
Use statements as accumulator & print size of test titles vs statemen…
Browse files Browse the repository at this point in the history
…t count.
  • Loading branch information
aljones15 committed Sep 11, 2024
1 parent 5a3bda1 commit 0abe081
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class Visitor {

export async function checkSpecText({specUrl, suiteLog}) {
const specUrls = Array.isArray(specUrl) ? specUrl : [specUrl];
const nodes = [];
const statements = [];
const specVisitor = new Visitor({
condition: textNodeWithMust,
accumulator: nodes,
accumulator: statements,
props: ['childNodes']
});
const tests = [];
Expand All @@ -51,6 +51,9 @@ export async function checkSpecText({specUrl, suiteLog}) {
testVisitor.visit({nodes: log.tests});
}
const testTitles = new Set(tests.map(test => test?.title));
const normStatements = new Set(statements);
console.log(`Test Title Count ${testTitles.size}`);
console.log(`Normative Statement Count ${normStatements.size}`);
}

// the condition for the spec
Expand Down

0 comments on commit 0abe081

Please sign in to comment.