Skip to content

Commit

Permalink
type check test files (#2059)
Browse files Browse the repository at this point in the history
* setup type safety for tests

* modify tsconfig.test.json for missing properties

* fix yarn.lock

* Update .github/workflows/main.yml

Co-authored-by: Justin Kaseman <[email protected]>
  • Loading branch information
karen-stepanyan and justinkaseman authored Jul 29, 2022
1 parent cac8b63 commit 9aedd1a
Show file tree
Hide file tree
Showing 194 changed files with 1,866 additions and 48 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
- run: yarn install
- run: yarn setup
- run: yarn lint
- run: yarn setup-tests
- run: yarn format:check

run-docmentation-check:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
packages/**/*.zip
dist
**/tsconfig.tsbuildinfo
**/tsconfig.test.tsbuildinfo
.DS_Store

# Yarn 2
Expand Down
1 change: 1 addition & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"format:check": "prettier --check .",
"format:fix": "prettier --write .",
"setup": "tsc -b ./packages/tsconfig.json",
"setup-tests": "tsc -b ./packages/tsconfig.test.json",
"test": "jest",
"test:unit": "jest unit",
"test:integration": "EA_PORT=0 jest integration",
Expand Down
7 changes: 7 additions & 0 deletions packages/composites/anchor/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/apy-finance/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/augur/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/bitcoin-json-rpc/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/bob/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/bsol-price/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/circuit-breaker/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/curve-3pool/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/defi-dozen/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/defi-pulse/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/dns-record-check/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/dxdao/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/dydx-rewards/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json", "test/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/google-weather/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/historical-average/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/implied-price/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/linear-finance/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/market-closure/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json", "types/**/*"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/medianizer/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/nftx/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/outlier-detection/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/por-indexer/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/proof-of-reserves/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/reference-transform/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/savax-price/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/set-token-index/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/synth-index/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json", "types/**/*"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/the-graph/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/token-allocation/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/vesper/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/composites/xsushi-price/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/core/bootstrap/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/core/factories/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/core/legos/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/core/reference-data-reader/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/core/test-helpers/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/examples/composite/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
7 changes: 7 additions & 0 deletions packages/examples/source/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*", "**/test", "src/**/*.json"],
"compilerOptions": {
"noEmit": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"tslib": "2.3.1"
},
"devDependencies": {
"@types/jest": "27.5.2",
"@types/supertest": "2.0.12",
"nock": "13.2.9",
"supertest": "6.2.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Requester } from '@chainlink/ea-bootstrap'
import { DataResponse, Requester, Value } from '@chainlink/ea-bootstrap'
import { balance } from '@chainlink/ea-factories'
import { Config, ExecuteFactory } from '@chainlink/ea-bootstrap'

Expand All @@ -13,14 +13,15 @@ const getBalance: balance.GetBalance = async (account, config) => {
...config.api,
url: `/address/${account.address}`,
headers: {
...config.api.headers,
...config?.api?.headers,
'blockchain-id': 'bitcoin-network',
},
}
const response = await Requester.request(reqConfig)
const data = response.data as DataResponse<Value, { value: string }>
return {
payload: response.data,
result: [{ ...account, balance: response.data.payload.value }],
payload: data,
result: [{ ...account, balance: data.payload?.value }],
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../../../../../tsconfig.base.json",
"include": ["src/**/*", "**/test"],
"compilerOptions": {
"noEmit": true
}
}
Loading

0 comments on commit 9aedd1a

Please sign in to comment.