1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-05 01:34:25 +00:00
gitea/vitest.config.js
silverwind 92e07f270a
Update JS dependencies (#24218)
- Update all js dependencies, update playwright image to jammy
- Adjust eslint and vitest config
- Tested build, monaco, mermaid, katex
2023-04-19 22:36:41 -04:00

36 lines
824 B
JavaScript

import {defineConfig} from 'vitest/dist/config.js';
import {readFile} from 'node:fs/promises';
import {dataToEsm} from '@rollup/pluginutils';
import {extname} from 'node:path';
import vue from '@vitejs/plugin-vue';
function stringPlugin() {
return {
name: 'string-plugin',
enforce: 'pre',
async load(id) {
const path = id.split('?')[0];
if (extname(path) !== '.svg') return null;
return dataToEsm(await readFile(path, 'utf8'));
}
};
}
export default defineConfig({
test: {
include: ['web_src/**/*.test.js'],
setupFiles: ['./web_src/js/test/setup.js'],
environment: 'jsdom',
testTimeout: 20000,
open: false,
allowOnly: true,
passWithNoTests: true,
watch: false,
outputDiffLines: Infinity,
},
plugins: [
stringPlugin(),
vue(),
],
});