Skip to content

Commit

Permalink
add real "peerdeps test" setup
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Sep 20, 2023
1 parent 2ac7446 commit 89ab48d
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 14 deletions.
33 changes: 19 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,6 @@ jobs:
- store_artifacts:
path: reports/junit

TestPeerDepTypes:
parameters:
externalPackage:
type: string
docker:
- image: cimg/node:20.6.1
steps:
- checkout
- run: npm run ci:precheck
- run: npm version
- run: npm ci
- run: npm install -D << parameters.externalPackage >>
- run: npm exec tsc

BuildTarball:
docker:
- image: cimg/node:20.6.1
Expand Down Expand Up @@ -100,6 +86,24 @@ jobs:
command: npm run test --workspace=<< parameters.framework >>
working_directory: integration-tests

TestPeerDepTypes:
parameters:
externalPackage:
type: string
docker:
- image: cimg/node:20.6.1
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
working_directory: integration-tests/peerdeps-tsc
command: |
npm install
npm install @apollo/client@/tmp/workspace/apollo-client.tgz
npm install << parameters.externalPackage >>
npm test
workflows:
Build and Test:
jobs:
Expand Down Expand Up @@ -135,3 +139,4 @@ workflows:
- "@types/[email protected] @types/[email protected]"
- "@types/react@17 @types/react-dom@17"
- "@types/react@18 @types/react-dom@18"
- "typescript@next"
5 changes: 5 additions & 0 deletions integration-tests/peerdeps-tsc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# explicitly avoiding to check in this one
# so we run this test always with the latest version
package-lock.json
dist
node_modules
20 changes: 20 additions & 0 deletions integration-tests/peerdeps-tsc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "peerdeps-tsc",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "tsc"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"graphql": "^16.0.0",
"graphql-ws": "^5.5.5",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"subscriptions-transport-ws": "^0.11.0",
"typescript": "latest"
}
}
1 change: 1 addition & 0 deletions integration-tests/peerdeps-tsc/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "@apollo/client";
17 changes: 17 additions & 0 deletions integration-tests/peerdeps-tsc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"rootDir": "./src",
"outDir": "./dist",
"declaration": true,
"sourceMap": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": false,
"types": ["react", "react-dom"],
"lib": ["es2018", "dom"]
}
}

0 comments on commit 89ab48d

Please sign in to comment.