chore: move all tests into a single folder (#4160)
This commit is contained in:
parent
3e21030536
commit
bd369d3b09
@ -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"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -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 () => {
|
||||||
@ -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'));
|
||||||
});
|
});
|
||||||
@ -57,7 +57,7 @@ beforeAll(async () => {
|
|||||||
type: 'replSet',
|
type: 'replSet',
|
||||||
serverOptions: {
|
serverOptions: {
|
||||||
replSet: {
|
replSet: {
|
||||||
count: 4
|
count: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user