Skip to content

Commit 84758d7

Browse files
authored
Fix server Jest test structure and standardize test scripts (#5909)
* fix(server): restructure Jest tests and standardize test scripts * chore(main.yml): run build before test
1 parent d8da27c commit 84758d7

7 files changed

Lines changed: 129 additions & 256 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
cache-dependency-path: 'pnpm-lock.yaml'
3232
- run: pnpm install
3333
- run: pnpm lint
34-
- run: pnpm test:coverage
3534
- run: pnpm build
3635
env:
3736
NODE_OPTIONS: '--max_old_space_size=4096'
37+
- run: pnpm test:coverage
3838
- name: Cypress install
3939
run: pnpm cypress install
4040
- name: Install dependencies (Cypress Action)

packages/server/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
"cypress:run": "cypress run",
4848
"e2e": "start-server-and-test dev http://localhost:3000 cypress:run",
4949
"cypress:ci": "START_SERVER_AND_TEST_INSECURE=1 start-server-and-test start https-get://localhost:3000 cypress:run",
50-
"test": "jest --runInBand --detectOpenHandles --forceExit"
50+
"test": "jest",
51+
"test:watch": "jest --watch",
52+
"test:coverage": "jest --coverage"
5153
},
5254
"keywords": [],
5355
"homepage": "https://flowiseai.com",

packages/server/test/index.test.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/server/test/routes/v1/organization-user.route.test.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

packages/server/test/routes/v1/user.route.test.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { generateAPIKey } from '../../src/utils/apiKey'
22

3-
export function apiKeyTest() {
4-
describe('Api Key', () => {
5-
it('should be able to generate a new api key', () => {
6-
const apiKey = generateAPIKey()
7-
expect(typeof apiKey === 'string').toEqual(true)
8-
})
3+
describe('Api Key', () => {
4+
it('should be able to generate a new api key', () => {
5+
const apiKey = generateAPIKey()
6+
expect(typeof apiKey === 'string').toEqual(true)
97
})
10-
}
8+
})

0 commit comments

Comments
 (0)