Skip to content

Commit

Permalink
Correct test runner test
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Jun 5, 2024
1 parent 99080ec commit 783cfa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/tests/tester/TestRunner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { construct_tester_components, load_expected_evaluation, scrub_errors } f

test('stories folder', async () => {
const { test_runner } = construct_tester_components('tools/tests/tester/fixtures/specs/indices_excerpt.yaml')
const result = await test_runner.run('tools/tests/tester/fixtures/stories', true)
const result = await test_runner.run('tools/tests/tester/fixtures/stories')

expect(result.failed).toBeTruthy()

Expand Down
6 changes: 3 additions & 3 deletions tools/tests/tester/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export function print_yaml (obj: any): void {

export function scrub_errors (obj: any): void {
for (const key in obj) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
if (key === 'error') obj[key] = obj[key].message
else if (typeof obj[key] === 'object') scrub_errors(obj[key])
if (typeof obj[key] !== 'object') continue
if (key === 'error') obj.error = obj.error.message
else scrub_errors(obj[key])
}
}

Expand Down

0 comments on commit 783cfa0

Please sign in to comment.