Skip to content

Commit

Permalink
Get basic tests working
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljharvey committed Apr 1, 2020
1 parent 0016efb commit 7e6a5c8
Show file tree
Hide file tree
Showing 7 changed files with 2,076 additions and 3,479 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
yarn-error.log
dist/
output/*.ts
node_modules/
19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,29 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"@types/prettier": "^1.19.1",
"fast-check": "^1.23.0",
"jest-runner-tsc": "^1.6.0",
"prettier": "^2.0.2",
"tsutils": "^3.17.1",
"typescript": "^3.8.3"
"prettier": "^2.0.2"
},
"scripts": {
"build": "tsc",
"codegen": "graphql-codegen",
"typescript:watch": "tsc --noEmit --watch",
"test": "./test.sh"
"test": "./test.sh && jest -c jest.tsc.config.js",
"test:watch": "./test.sh && jest -c jest.tsc.config.js --watch"
},
"devDependencies": {
"@types/graphql": "^14.5.0",
"@types/jest": "^25.1.4",
"@types/node": "^13.9.8",
"@types/prettier": "^1.19.1",
"graphql": "^14.6.0",
"jest": "^25.2.4"
"jest": "^25.2.4",
"jest-runner-tsc": "^1.6.0",
"typescript": "^3.8.3",
"@graphql-codegen/cli": "^1.13.1"
},
"peerDependencies": {
"@graphql-codegen/cli": "^1.13.1",
"graphql": "^14.6.0"
}
}
9 changes: 5 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash

# lets set up a test environment
# die if anything goes wrong
set -euxo pipefail

# compile typescript
yarn build

graphql-codegen --config ./test/codegen.yml

yarn jest -c jest.tsc.config.js
# run codegen
yarn graphql-codegen --verbose --config ./test/codegen.yml
6 changes: 3 additions & 3 deletions test/codegen.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
schema: ./test/twitter-schema.graphql
schema: ./test/test-schema.graphql
# documents: './src/**/*.graphql'
generates:
./dist/index.js:
- ./output/output.ts:
./output/output.ts:
- ./dist/index.js
File renamed without changes.

0 comments on commit 7e6a5c8

Please sign in to comment.