Skip to content

Conversation

@ckwalsh
Copy link
Contributor

@ckwalsh ckwalsh commented May 2, 2025

Summary:
This logic can hide breakages and cause tests to pass when the
underlying logic is actually broken. I encountered these hidden
breakages while working on some further feature changes, and figured
it was appropriate to fix this first.

As all existing tests pass without the try/catch, this change is
effectively a no-op.

Test Plan:
yarn install && yarn run test ./tests/

Stack created with Sapling. Best reviewed with ReviewStack.

} catch (e) {
console.error(e, path);
}
expect(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for suggestion! I totally agreed that ignoring is bad practice, but could we keep try-catch block and throw a different error for enhancing maintainability?

Suggested change
expect(
try {
expect(
raw(source + '~'.repeat(80) + '\n' + (await output)),
).toMatchSnapshot(filename);
} catch (e) {
throw new Error(`Problem occurred in ${path} file: ${error.name}`)
}

@ckwalsh ckwalsh force-pushed the pr355 branch 2 times, most recently from 3f3163a to ff247e1 Compare July 18, 2025 19:45
@vladislavarsenev vladislavarsenev changed the base branch from main to v6 October 17, 2025 09:57
Summary:
This logic can hide breakages and cause tests to pass when the
underlying logic is actually broken. I encountered these hidden
breakages while working on some further feature changes, and figured
it was appropriate to fix this first.

As all existing tests pass without the try/catch, this change is
effectively a no-op.

Test Plan:
`yarn install && yarn run test ./tests/`
@vladislavarsenev vladislavarsenev merged commit 92e5374 into trivago:v6 Oct 17, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants