Skip to content

Commit aa5bd7c

Browse files
authored
Merge pull request #785 from Shopify/test-helper-should-throw
`check` test helper shouldn't silently swallow errors
2 parents 9a4cfc9 + b1c6abe commit aa5bd7c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/theme-check-common/src/test/test-helper.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,19 @@ export function getTheme(themeDesc: MockTheme): Theme {
3939

4040
export async function check(
4141
themeDesc: MockTheme,
42-
checks: CheckDefinition<SourceCodeType>[] = recommended,
42+
checks: CheckDefinition[] = recommended,
4343
mockDependencies: Partial<Dependencies> = {},
4444
checkSettings: ChecksSettings = {},
4545
): Promise<Offense[]> {
4646
const theme = getTheme(themeDesc);
4747
const config: Config = {
4848
context: 'theme',
4949
settings: { ...checkSettings },
50-
checks: checks,
50+
checks,
5151
rootUri,
52+
onError: (err) => {
53+
throw err;
54+
},
5255
};
5356

5457
const sections = new Map(

0 commit comments

Comments
 (0)