chore: move all tests into a single folder (#4160)

This commit is contained in:
Finley Ge 2025-03-14 11:39:44 +08:00 committed by GitHub
parent 3e21030536
commit bd369d3b09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@
"previewIcon": "node ./scripts/icon/index.js", "previewIcon": "node ./scripts/icon/index.js",
"api:gen": "tsc ./scripts/openapi/index.ts && node ./scripts/openapi/index.js && npx @redocly/cli build-docs ./scripts/openapi/openapi.json -o ./projects/app/public/openapi/index.html", "api:gen": "tsc ./scripts/openapi/index.ts && node ./scripts/openapi/index.js && npx @redocly/cli build-docs ./scripts/openapi/openapi.json -o ./projects/app/public/openapi/index.html",
"create:i18n": "node ./scripts/i18n/index.js", "create:i18n": "node ./scripts/i18n/index.js",
"test": "vitest run --exclude './projects/app/src/test/**'", "test": "vitest run --exclude 'test/cases/spec'",
"test:all": "vitest run", "test:all": "vitest run",
"test:workflow": "vitest run workflow" "test:workflow": "vitest run workflow"
}, },

View File

@ -1,12 +1,12 @@
import { MongoApp } from '@fastgpt/service/core/app/schema'; import { MongoApp } from '@fastgpt/service/core/app/schema';
import { MongoAppVersion } from '@fastgpt/service/core/app/version/schema'; import { MongoAppVersion } from '@fastgpt/service/core/app/version/schema';
import { getRootUser } from './datas/users'; import { getRootUser } from '@test/datas/users';
import { Call } from './utils/request'; import { Call } from '@test/utils/request';
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vitest';
import handler, { import handler, {
type versionListBody, type versionListBody,
type versionListResponse type versionListResponse
} from '../projects/app/src/pages/api/core/app/version/list'; } from '@/pages/api/core/app/version/list';
describe('app version list test', () => { describe('app version list test', () => {
it('should return app version list', async () => { it('should return app version list', async () => {

View File

@ -74,9 +74,9 @@ const testWorkflow = async (path: string) => {
it('Workflow test: simple workflow', async () => { it('Workflow test: simple workflow', async () => {
// create a simple app // create a simple app
await testWorkflow('projects/app/src/test/workflow/simple.json'); await testWorkflow('test/cases/workflow/simple.json');
}); });
it('Workflow test: output test', async () => { it('Workflow test: output test', async () => {
console.log(await testWorkflow('projects/app/src/test/workflow/loopTest.json')); console.log(await testWorkflow('test/cases/workflow/loopTest.json'));
}); });

View File

@ -57,7 +57,7 @@ beforeAll(async () => {
type: 'replSet', type: 'replSet',
serverOptions: { serverOptions: {
replSet: { replSet: {
count: 4 count: 1
} }
} }
}); });

View File

@ -10,7 +10,7 @@ export default defineConfig({
}, },
outputFile: 'test-results.json', outputFile: 'test-results.json',
setupFiles: ['./test/setup.ts'], setupFiles: ['./test/setup.ts'],
include: ['./test/test.ts', './projects/app/**/*.test.ts'], include: ['./test/test.ts', './test/cases/**/*.test.ts'],
testTimeout: 5000 testTimeout: 5000
}, },
resolve: { resolve: {