Skip to content

Commit 79365d8

Browse files
FinleyGec121914yu
authored andcommitted
chore: move all tests into a single folder (#4160)
1 parent edd8ba9 commit 79365d8

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"previewIcon": "node ./scripts/icon/index.js",
1313
"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",
1414
"create:i18n": "node ./scripts/i18n/index.js",
15-
"test": "vitest run --exclude './projects/app/src/test/**'",
15+
"test": "vitest run --exclude 'test/cases/spec'",
1616
"test:all": "vitest run",
1717
"test:workflow": "vitest run workflow"
1818
},

test/list.test.ts renamed to test/cases/api/core/app/version/list.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { MongoApp } from '@fastgpt/service/core/app/schema';
22
import { MongoAppVersion } from '@fastgpt/service/core/app/version/schema';
3-
import { getRootUser } from './datas/users';
4-
import { Call } from './utils/request';
3+
import { getRootUser } from '@test/datas/users';
4+
import { Call } from '@test/utils/request';
55
import { describe, expect, it } from 'vitest';
66
import handler, {
77
type versionListBody,
88
type versionListResponse
9-
} from '../projects/app/src/pages/api/core/app/version/list';
9+
} from '@/pages/api/core/app/version/list';
1010

1111
describe('app version list test', () => {
1212
it('should return app version list', async () => {
File renamed without changes.

projects/app/src/test/workflow/workflow.test.ts renamed to test/cases/spec/workflow/workflow.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ const testWorkflow = async (path: string) => {
7474

7575
it('Workflow test: simple workflow', async () => {
7676
// create a simple app
77-
await testWorkflow('projects/app/src/test/workflow/simple.json');
77+
await testWorkflow('test/cases/workflow/simple.json');
7878
});
7979

8080
it('Workflow test: output test', async () => {
81-
console.log(await testWorkflow('projects/app/src/test/workflow/loopTest.json'));
81+
console.log(await testWorkflow('test/cases/workflow/loopTest.json'));
8282
});

test/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ beforeAll(async () => {
5757
type: 'replSet',
5858
serverOptions: {
5959
replSet: {
60-
count: 4
60+
count: 1
6161
}
6262
}
6363
});

vitest.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default defineConfig({
1010
},
1111
outputFile: 'test-results.json',
1212
setupFiles: ['./test/setup.ts'],
13-
include: ['./test/test.ts', './projects/app/**/*.test.ts'],
13+
include: ['./test/test.ts', './test/cases/**/*.test.ts'],
1414
testTimeout: 5000
1515
},
1616
resolve: {

0 commit comments

Comments
 (0)