mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
734 B
33 lines
734 B
2 years ago
|
import {defineConfig} from 'vitest/dist/config.js';
|
||
|
import {readFile} from 'fs/promises';
|
||
|
import {dataToEsm} from '@rollup/pluginutils';
|
||
|
import {extname} from 'path';
|
||
|
|
||
|
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(),
|
||
|
],
|
||
|
});
|