- displayHtml uses a dedicated DOMPurify 3.4.16 instance: EDITOR_TAGS, href only on <a> through isAllowedLink, DROPPED elements go with their content - string in, string out: parsed into DOMPurify's inert document, nothing adopted into the live document before binding - fails closed (empty string) unless isSupported and a fixed canary hold - Vitest browser mode in Playwright Chromium (npm run test:browser) covers the clobbering vectors, off-origin form, iframe, meta refresh, links and the inert parse; happy-dom keeps engine-independent assertions
15 lines
424 B
TypeScript
15 lines
424 B
TypeScript
import { configDefaults, defineConfig } from 'vitest/config'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
test: {
|
|
environment: 'happy-dom',
|
|
include: ['tests/**/*.test.ts'],
|
|
// tests/browser needs a real engine: vitest.browser.config.ts.
|
|
exclude: [...configDefaults.exclude, 'tests/browser/**'],
|
|
setupFiles: ['tests/setup.ts'],
|
|
restoreMocks: true,
|
|
},
|
|
})
|