Skip to content

Commit

Permalink
Custom element test now has two classic scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Jun 10, 2022
1 parent adf4265 commit f52864c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/astro/test/custom-elements.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Custom Elements', () => {

// Hydration
// test 3: Component and polyfill scripts bundled separately
expect($('script[type=module]')).to.have.lengthOf(1);
expect($('script')).to.have.lengthOf(2);
});

it('Custom elements not claimed by renderer are rendered as regular HTML', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export default function () {
hooks: {
'astro:config:setup': ({ updateConfig, addRenderer, injectScript }) => {
// Inject the necessary polyfills on every page
injectScript('head-inline', `import '@test/custom-element-renderer/polyfill.js';`);
injectScript('head-inline', `import('@test/custom-element-renderer/polyfill.js');`);
// Inject the hydration code, before a component is hydrated.
injectScript('before-hydration', `import '@test/custom-element-renderer/hydration-polyfill.js';`);
injectScript('before-hydration', `import('@test/custom-element-renderer/hydration-polyfill.js');`);
// Add the lit renderer so that Astro can understand lit components.
addRenderer({
name: '@test/custom-element-renderer',
Expand Down

0 comments on commit f52864c

Please sign in to comment.