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 archer
parent edd8ba9e5a
commit 79365d854c
No known key found for this signature in database
GPG Key ID: 4446499B846D4A9E
7 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@
"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",
"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:workflow": "vitest run workflow"
},

View File

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

View File

@ -74,9 +74,9 @@ const testWorkflow = async (path: string) => {
it('Workflow test: simple workflow', async () => {
// 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 () => {
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',
serverOptions: {
replSet: {
count: 4
count: 1
}
}
});

View File

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