Skip to content

Commit

Permalink
Updating GraphQL resolver tests
Browse files Browse the repository at this point in the history
  • Loading branch information
45930 committed Nov 21, 2024
1 parent 1bad4d3 commit 977dbe0
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 121 deletions.
1 change: 1 addition & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- 5432:5432
- 8080:8080
- 8181:8181
- 8282:8282
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build": "npm run clean && npx tsc",
"start": "node build/src/index.js",
"dev": "cross-env NODE_NO_WARNINGS=1 npx nodemon src/index.ts",
"test": "npx tsc && for testfile in $(find build/tests -type f -name '*.test.js'); do node $testfile; done",
"test": "./run-tests.sh",
"clean": "rimraf ./build",
"gen-test-mocks": "cross-env NODE_NO_WARNINGS=1 node --loader ts-node/esm tests/mocked_sql/generate_mock_data.ts",
"benchmark": "cross-env NODE_NO_WARNINGS=1 node --loader ts-node/esm benchmark/setup.ts && npx artillery run benchmark/graphql.yaml --output benchmark/report.json",
Expand Down
11 changes: 11 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
shopt -s globstar # to expand '**' into nested directories./

npm run build

# find all unit tests in build and run them
for f in ./build/**/*test.js; do
echo "Running $f"
node --enable-source-maps --stack-trace-limit=1000 --test $f;
done
Loading

0 comments on commit 977dbe0

Please sign in to comment.