0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

[ci] yarn format

This commit is contained in:
natemoo-re 2021-12-01 21:27:46 +00:00 committed by GitHub Actions
parent 920d3da135
commit 638982663e
2 changed files with 4 additions and 4 deletions

View file

@ -75,12 +75,12 @@ export function extractDirectives(inputProps: Record<string | number, any>): Ext
// throw an error if an invalid hydration directive was provided
if (HydrationDirectives.indexOf(extracted.hydration.directive) < 0) {
throw new Error(`Error: invalid hydration directive "${key}". Supported hydration methods: ${HydrationDirectives.map(d => `"client:${d}"`).join(', ')}`)
throw new Error(`Error: invalid hydration directive "${key}". Supported hydration methods: ${HydrationDirectives.map((d) => `"client:${d}"`).join(', ')}`);
}
// throw an error if the query wasn't provided for client:media
if (extracted.hydration.directive === 'media' && typeof extracted.hydration.value !== 'string') {
throw new Error('Error: Media query must be provided for "client:media", similar to client:media="(max-width: 600px)"')
throw new Error('Error: Media query must be provided for "client:media", similar to client:media="(max-width: 600px)"');
}
break;

View file

@ -61,7 +61,7 @@ describe('Error display', () => {
// error message contains error
const body = await res.text();
// error message contains error
expect(body).to.include('Error: invalid hydration directive');
});
@ -76,7 +76,7 @@ describe('Error display', () => {
// error message contains error
const body = await res.text();
// error message contains error
expect(body).to.include('Error: Media query must be provided');
});