pull:初次提交
This commit is contained in:
38
n8n-n8n-1.109.2/packages/@n8n/vitest-config/frontend.ts
Executable file
38
n8n-n8n-1.109.2/packages/@n8n/vitest-config/frontend.ts
Executable file
@@ -0,0 +1,38 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import type { InlineConfig } from 'vitest/node';
|
||||
|
||||
export const createVitestConfig = (options: InlineConfig = {}) => {
|
||||
const vitestConfig = defineConfig({
|
||||
test: {
|
||||
silent: true,
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
setupFiles: ['./src/__tests__/setup.ts'],
|
||||
coverage: {
|
||||
enabled: false,
|
||||
all: false,
|
||||
provider: 'v8',
|
||||
reporter: ['text-summary', 'lcov', 'html-spa'],
|
||||
},
|
||||
css: {
|
||||
modules: {
|
||||
classNameStrategy: 'non-scoped',
|
||||
},
|
||||
},
|
||||
...options,
|
||||
},
|
||||
});
|
||||
|
||||
if (process.env.COVERAGE_ENABLED === 'true' && vitestConfig.test?.coverage) {
|
||||
const { coverage } = vitestConfig.test;
|
||||
coverage.enabled = true;
|
||||
if (process.env.CI === 'true' && coverage.provider === 'v8') {
|
||||
coverage.all = true;
|
||||
coverage.reporter = ['cobertura'];
|
||||
}
|
||||
}
|
||||
|
||||
return vitestConfig;
|
||||
};
|
||||
|
||||
export const vitestConfig = createVitestConfig();
|
||||
27
n8n-n8n-1.109.2/packages/@n8n/vitest-config/node.ts
Executable file
27
n8n-n8n-1.109.2/packages/@n8n/vitest-config/node.ts
Executable file
@@ -0,0 +1,27 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import type { InlineConfig } from 'vitest/node';
|
||||
|
||||
export const createVitestConfig = (options: InlineConfig = {}) => {
|
||||
const vitestConfig = defineConfig({
|
||||
test: {
|
||||
silent: true,
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
...(process.env.COVERAGE_ENABLED === 'true'
|
||||
? {
|
||||
coverage: {
|
||||
enabled: true,
|
||||
provider: 'v8',
|
||||
reporter: process.env.CI === 'true' ? 'cobertura' : 'text-summary',
|
||||
all: true,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...options,
|
||||
},
|
||||
});
|
||||
|
||||
return vitestConfig;
|
||||
};
|
||||
|
||||
export const vitestConfig = createVitestConfig();
|
||||
45
n8n-n8n-1.109.2/packages/@n8n/vitest-config/package.json
Executable file
45
n8n-n8n-1.109.2/packages/@n8n/vitest-config/package.json
Executable file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@n8n/vitest-config",
|
||||
"version": "1.5.0",
|
||||
"type": "module",
|
||||
"peerDependencies": {
|
||||
"vite": "catalog:",
|
||||
"vitest": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@n8n/typescript-config": "workspace:*",
|
||||
"vite": "catalog:",
|
||||
"vitest": "catalog:"
|
||||
},
|
||||
"files": [
|
||||
"backend.mjs",
|
||||
"frontend.mjs"
|
||||
],
|
||||
"exports": {
|
||||
"./backend": {
|
||||
"import": "./backend.mjs",
|
||||
"require": "./backend.mjs",
|
||||
"types": "./backend.d.ts"
|
||||
},
|
||||
"./frontend": {
|
||||
"import": "./dist/frontend.js",
|
||||
"require": "./dist/frontend.js",
|
||||
"types": "./dist/frontend.d.ts"
|
||||
},
|
||||
"./node": {
|
||||
"import": "./dist/node.js",
|
||||
"require": "./dist/node.js",
|
||||
"types": "./dist/node.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist .turbo",
|
||||
"dev": "pnpm watch",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "tsc -p tsconfig.build.json",
|
||||
"format": "biome format --write .",
|
||||
"format:check": "biome ci .",
|
||||
"watch": "tsc -p tsconfig.build.json --watch"
|
||||
},
|
||||
"license": "See LICENSE.md file in the root of the repository"
|
||||
}
|
||||
11
n8n-n8n-1.109.2/packages/@n8n/vitest-config/tsconfig.build.json
Executable file
11
n8n-n8n-1.109.2/packages/@n8n/vitest-config/tsconfig.build.json
Executable file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"],
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"rootDir": ".",
|
||||
"outDir": "dist",
|
||||
"tsBuildInfoFile": "dist/build.tsbuildinfo"
|
||||
},
|
||||
"include": ["**/*.ts"],
|
||||
"exclude": ["dist", "**/*.test.ts"]
|
||||
}
|
||||
13
n8n-n8n-1.109.2/packages/@n8n/vitest-config/tsconfig.json
Executable file
13
n8n-n8n-1.109.2/packages/@n8n/vitest-config/tsconfig.json
Executable file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "@n8n/typescript-config/tsconfig.common.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"types": ["node"],
|
||||
"baseUrl": ".",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
|
||||
},
|
||||
"include": ["**/*.ts"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
Reference in New Issue
Block a user