File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
packages/sources/stader-balance/test/integration Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 73
73
- name : Compile tests
74
74
env :
75
75
CHANGED_PACKAGES : ${{ needs.install-packages.outputs.changed-packages }}
76
- run : yarn tsc -b --noEmit $(echo $CHANGED_PACKAGES | jq '.[].location + "/tsconfig.test.json"' -r | grep -v -E '/composites/dydx-rewards/|/composites/glv-token/|/composites/gm-token/|/core/bootstrap/|/sources/aleno/|/sources/bitgo-reserves-test/|/sources/bitgo-reserves/|/sources/coinpaprika/|/sources/cryptocompare/|/sources/dlc-btc-por/|/sources/eth-beacon/|/sources/icap/|/sources/ipfs/|/sources/layer2-sequencer-health/|/sources/por-address-list/|/sources/s3-csv-reader/|/sources/stader-balance/|/sources/token-balance/|/sources/view-function-multi-chain/|sources/view-function/')
76
+ FAILING_TESTS_PATTERN : ' /composites/dydx-rewards/|/composites/glv-token/|/composites/gm-token/|/core/bootstrap/|/sources/aleno/|/sources/bitgo-reserves-test/|/sources/bitgo-reserves/|/sources/coinpaprika/|/sources/cryptocompare/|/sources/dlc-btc-por/|/sources/eth-beacon/|/sources/icap/|/sources/ipfs/|/sources/layer2-sequencer-health/|/sources/por-address-list/|/sources/s3-csv-reader/|/sources/token-balance/|/sources/view-function-multi-chain/|sources/view-function/'
77
+ run : |
78
+ # Tests that should compile:
79
+ yarn tsc -b --noEmit $(echo $CHANGED_PACKAGES | jq '.[].location + "/tsconfig.test.json"' -r | grep -v -E "$FAILING_TESTS_PATTERN")
80
+ # Tests that should not compile:
81
+ for package in $(echo "$CHANGED_PACKAGES" | jq '.[].location + "/"' -r | grep -E "$FAILING_TESTS_PATTERN"); do
82
+ if yarn tsc -b --noEmit "${package}tsconfig.test.json"; then
83
+ echo "Compilation succeeded for $package. Remove it from FAILING_TESTS_PATTERN so it doesn't break again in the future."
84
+ exit 1
85
+ fi
86
+ done
77
87
78
88
# Run unit tests
79
89
unit-tests :
Original file line number Diff line number Diff line change
1
+ import type BigNumber from 'bignumber.js'
1
2
import {
2
3
addressData ,
3
4
mockCollateralEthMap ,
@@ -17,11 +18,16 @@ import {
17
18
import { deferredPromise , sleep } from '@chainlink/external-adapter-framework/util'
18
19
import * as nock from 'nock'
19
20
20
- const totalPenaltyAmountCalls = { }
21
+ type TotalPenaltyAmountCall = {
22
+ resolve : ( ) => void
23
+ promise : Promise < BigNumber >
24
+ }
25
+
26
+ const totalPenaltyAmountCalls : Record < string , TotalPenaltyAmountCall > = { }
21
27
22
- const getTotalPenaltyAmount = ( address ) => {
28
+ const getTotalPenaltyAmount = ( address : string ) => {
23
29
if ( ! ( address in totalPenaltyAmountCalls ) ) {
24
- const [ promise , resolve ] = deferredPromise ( )
30
+ const [ promise , resolve ] = deferredPromise < BigNumber > ( )
25
31
totalPenaltyAmountCalls [ address ] = {
26
32
resolve : ( ) => resolve ( mockPenaltyMap [ address ] ) ,
27
33
promise,
You can’t perform that action at this time.
0 commit comments