Skip to content

Commit

Permalink
refactor: added pending statement to main if statement
Browse files Browse the repository at this point in the history
Signed-off-by: Tokesh <[email protected]>
  • Loading branch information
Tokesh committed Jan 5, 2025
1 parent 7064c38 commit 545df1d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/src/tester/StoryEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ export default class StoryEvaluator {
const evaluations: ChapterEvaluation[] = []
for (const chapter of chapters) {
const title = chapter.synopsis || `${chapter.method} ${chapter.path}`
if (chapter.pending != null && chapter.pending) {
evaluations.push({ title, overall: { result: Result.IGNORED, message: chapter.pending } })
continue
}

if (dry_run) {
evaluations.push({ title, overall: { result: Result.SKIPPED, message: 'Dry Run' } })
} else if (distribution != undefined && chapter.distributions?.included !== undefined && chapter.distributions?.included.length > 0 && !chapter.distributions.included.includes(distribution)) {
Expand All @@ -123,6 +120,9 @@ export default class StoryEvaluator {
evaluations.push({ title, overall: { result: Result.SKIPPED, message: `Skipped because distribution ${distribution} is ${chapter.distributions.excluded.length > 1 ? 'one of ' : ''}${chapter.distributions.excluded.join(', ')}.` } })
} else if (version != undefined && chapter.version !== undefined && !semver.satisfies(version, chapter.version)) {
evaluations.push({ title, overall: { result: Result.SKIPPED, message: `Skipped because version ${version} does not satisfy ${chapter.version}.` } })
} else if (chapter.pending != null && chapter.pending) {
evaluations.push({ title, overall: { result: Result.IGNORED, message: chapter.pending } })
continue
} else {
const evaluation = await this._chapter_evaluator.evaluate(chapter, has_errors, story_outputs)
has_errors = has_errors || evaluation.overall.result === Result.ERROR
Expand Down

0 comments on commit 545df1d

Please sign in to comment.