Feature/SW-3365 reduce upscaling of images (fix blurry images) * fix: handle when images are wider than 3:2 but rendered in a 3:2 container * use dimensions everywhere applicable * fall back to using <img sizes='auto' /> if possible * imageLoader: never nest * remove empty test file Approved-by: Anton Gunnarsson Approved-by: Matilda Landström
57 lines
1.5 KiB
TypeScript
57 lines
1.5 KiB
TypeScript
import { defineConfig, mergeConfig } from 'vitest/config'
|
|
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'
|
|
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const dirname =
|
|
typeof __dirname !== 'undefined'
|
|
? __dirname
|
|
: path.dirname(fileURLToPath(import.meta.url))
|
|
|
|
import viteConfig from './vite.config'
|
|
|
|
const isCI = process.env.CI === 'true'
|
|
|
|
const browserInstances = isCI
|
|
? [{ browser: 'chromium' }]
|
|
: [{ browser: 'chromium' }, { browser: 'firefox' }, { browser: 'webkit' }]
|
|
|
|
export default mergeConfig(
|
|
viteConfig,
|
|
defineConfig({
|
|
test: {
|
|
projects: [
|
|
{
|
|
test: {
|
|
name: 'unit',
|
|
environment: 'jsdom',
|
|
},
|
|
},
|
|
{
|
|
plugins: [
|
|
storybookTest({
|
|
// The location of your Storybook config, main.js|ts
|
|
configDir: path.join(dirname, '.storybook'),
|
|
// This should match your package.json script to run Storybook
|
|
// The --ci flag will skip prompts and not open a browser
|
|
storybookScript: 'yarn storybook --ci',
|
|
}),
|
|
],
|
|
test: {
|
|
name: 'storybook',
|
|
// Enable browser mode
|
|
browser: {
|
|
enabled: true,
|
|
// Make sure to install Playwright
|
|
provider: 'playwright',
|
|
headless: true,
|
|
instances: browserInstances,
|
|
},
|
|
setupFiles: ['./.storybook/vitest.setup.ts'],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
})
|
|
)
|