1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-02 08:57:32 -04:00
gitea/vitest.config.js
wxiaoguang aa9c920980
Improve action log display with control chars (#23820)
Close #23680

Some CLI programs use "\r" and control chars to print new content in
current line.

So, the strings in one line are actually from
`\rReading...1%\rReading...5%\rReading...100%`

This PR tries to make the output better.
2023-04-01 20:57:05 +08:00

35 lines
793 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,
},
plugins: [
stringPlugin(),
vue(),
],
});