diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/astro/test/astro-client-only.test.js | 10 | ||||
-rw-r--r-- | packages/astro/test/css-order-import.test.js | 10 | ||||
-rw-r--r-- | packages/astro/test/fixtures/vue-component/astro.config.mjs | 22 | ||||
-rw-r--r-- | packages/integrations/svelte/src/index.ts | 1 |
4 files changed, 25 insertions, 18 deletions
diff --git a/packages/astro/test/astro-client-only.test.js b/packages/astro/test/astro-client-only.test.js index 9f6de9116..92b1beda4 100644 --- a/packages/astro/test/astro-client-only.test.js +++ b/packages/astro/test/astro-client-only.test.js @@ -37,8 +37,9 @@ describe('Client only components', () => { ); const css = stylesheets.join(''); - expect(css).to.match(/yellowgreen/, 'Svelte styles are added'); - expect(css).to.match(/Courier New/, 'Global styles are added'); + // yellowgreen minified + expect(css).to.contain('#9acd32', 'Svelte styles are added'); + expect(css).to.include('Courier New', 'Global styles are added'); }); it('Adds the CSS to the page - standalone svelte component', async () => { @@ -102,8 +103,9 @@ describe('Client only components subpath', () => { ); const css = stylesheets.join(''); - expect(css).to.match(/yellowgreen/, 'Svelte styles are added'); - expect(css).to.match(/Courier New/, 'Global styles are added'); + // yellowgreen minified + expect(css).to.contain('#9acd32', 'Svelte styles are added'); + expect(css).to.include('Courier New', 'Global styles are added'); }); it('Adds the CSS to the page for TSX components', async () => { diff --git a/packages/astro/test/css-order-import.test.js b/packages/astro/test/css-order-import.test.js index 9a5cf6933..b2a8a0a06 100644 --- a/packages/astro/test/css-order-import.test.js +++ b/packages/astro/test/css-order-import.test.js @@ -101,9 +101,9 @@ describe('CSS ordering - import order', () => { const content = await Promise.all(getLinks(html).map((href) => getLinkContent(href))); const [{ css }] = content; - let idx1 = css.indexOf('whitesmoke'); - let idx2 = css.indexOf('aliceblue'); - let idx3 = css.indexOf('burlywood'); + let idx1 = css.indexOf('#f5f5f5'); // whitesmoke minified + let idx2 = css.indexOf('#f0f8ff'); // aliceblue minified + let idx3 = css.indexOf('#deb887'); // burlywoord minified expect(idx1).to.be.greaterThan(idx2); expect(idx2).to.be.greaterThan(idx3); @@ -147,8 +147,8 @@ describe('CSS ordering - import order', () => { getLinks(html).map((href) => getLinkContent(href, fixture)) ); let [link1, link2] = content; - expect(link1.css).to.contain('aliceblue'); - expect(link2.css).to.contain('yellow'); + expect(link1.css).to.contain('f0f8ff'); // aliceblue minified + expect(link2.css).to.contain('#ff0'); // yellow minified }); }); }); diff --git a/packages/astro/test/fixtures/vue-component/astro.config.mjs b/packages/astro/test/fixtures/vue-component/astro.config.mjs index 0e870b2b4..6b95b43a6 100644 --- a/packages/astro/test/fixtures/vue-component/astro.config.mjs +++ b/packages/astro/test/fixtures/vue-component/astro.config.mjs @@ -3,11 +3,17 @@ import vue from '@astrojs/vue'; // https://astro.build/config export default defineConfig({ - integrations: [vue({ - template: { - compilerOptions: { - isCustomElement: tag => tag.includes('my-button') - } - } - })], -});
\ No newline at end of file + integrations: [ + vue({ + template: { + compilerOptions: { + isCustomElement: (tag) => tag.includes('my-button'), + }, + // Don't transform img src to imports + transformAssetUrls: { + includeAbsolute: false, + }, + }, + }), + ], +}); diff --git a/packages/integrations/svelte/src/index.ts b/packages/integrations/svelte/src/index.ts index b894ee623..695214223 100644 --- a/packages/integrations/svelte/src/index.ts +++ b/packages/integrations/svelte/src/index.ts @@ -73,7 +73,6 @@ async function getViteConfiguration({ } if (!resolvedOptions.preprocess && !(await svelteConfigHasPreprocess(root))) { - // @ts-expect-error there's a bug with the types where the first arg should be optional resolvedOptions.preprocess = vitePreprocess(); } |