Skip to content

Commit e7a47b5

Browse files
n1ru4lardatan
andauthored
chore: separate unit and integration tests (#1567)
* separate unit and integration tests * split integration and unit tests * run tests in parallel * fix: typo * fix: handle invalid JSON body * gget whole response * chore: ignore svelte and fastify on Node <= 14 * move readiness check to integration tests * chore: fix regex??? * chore: increase test timeout for integration tests ok * lol you should run the code locally before for pushing * chore: add dependency for pleasing vercelino * chore: "fix" integration test * chore: run as precheck * cover more cases for the accept header * chore: remove debug info * renable test * Fix tests Co-authored-by: Arda TANRIKULU <[email protected]>
1 parent 77dcf4b commit e7a47b5

File tree

47 files changed

+2618
-2114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2618
-2114
lines changed

.changeset/happy-dolls-shout.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'graphql-yoga': patch
3+
---
4+
5+
Handle invalid JSON body gracefully

.github/workflows/ci.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,41 @@ jobs:
4545
- name: Run Tests
4646
run: yarn test
4747

48+
test-integration:
49+
name: Run integration tests
50+
runs-on: ubuntu-latest
51+
strategy:
52+
matrix:
53+
node-version: [14, 16, 18]
54+
fail-fast: false
55+
steps:
56+
- name: Checkout Repository
57+
uses: actions/checkout@v3
58+
59+
- name: Use Node ${{ matrix.node-version }}
60+
uses: actions/setup-node@master
61+
with:
62+
node-version: ${{ matrix.node-version }}
63+
cache: 'yarn'
64+
65+
- name: Cache Node Modules
66+
uses: actions/cache@v3
67+
id: node-modules-cache-test-node
68+
with:
69+
path: '**/node_modules'
70+
key: ${{runner.os}}-${{ matrix.node-version }}-node-modules-${{hashFiles('yarn.lock')}}-${{hashFiles('patches/**/*')}}
71+
restore-keys: |
72+
${{runner.os}}-${{ matrix.node-version }}-node-modules-${{hashFiles('yarn.lock')}}-${{hashFiles('patches/**/*')}}
73+
- name: Install Dependencies using Yarn
74+
run: yarn install --ignore-engines --frozen-lockfile --immutable
75+
if: steps.node-modules-cache-test-node.outputs.cache-hit != 'true'
76+
77+
- name: Build Packages
78+
run: yarn build
79+
80+
- name: Run Tests
81+
run: yarn test:integration
82+
4883
test-esm:
4984
name: Testing with Node ESM
5085
runs-on: ubuntu-latest
@@ -74,8 +109,7 @@ jobs:
74109
run: yarn build
75110

76111
- name: Run Tests
77-
working-directory: ./examples/node-esm
78-
run: yarn test
112+
run: yarn workspace example-node-esm run test
79113

80114
typecheck:
81115
name: Typecheck
File renamed without changes.

examples/cloudflare-modules/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"skipLibCheck": true
1010
},
1111
"include": ["src"],
12-
"exclude": ["node_modules", "dist", "test"]
12+
"exclude": ["node_modules", "dist", "__integration-tests__"]
1313
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/koa/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"skipLibCheck": true
1010
},
1111
"include": ["src"],
12-
"exclude": ["node_modules", "dist", "test"]
12+
"exclude": ["node_modules", "dist", "__integration-tests__"]
1313
}

0 commit comments

Comments
 (0)