mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
added scenarios engine for subgraph testing
This commit is contained in:
parent
71262fbd5d
commit
9530dd115d
|
@ -41,6 +41,7 @@
|
|||
"test-liquidate": "buidler test test/__setup.spec.ts test/liquidation-atoken.spec.ts",
|
||||
"test-pausable": "buidler test test/__setup.spec.ts test/pausable-functions.spec.ts",
|
||||
"test-permit": "buidler test test/__setup.spec.ts test/atoken-permit.spec.ts",
|
||||
"test-subgraph:scenarios": "buidler --network buidlerevm_docker test test/__setup.spec.ts test/subgraph-scenarios.spec.ts",
|
||||
"dev:coverage": "buidler coverage --network coverage",
|
||||
"dev:deployment": "buidler dev-deployment",
|
||||
"dev:deployExample": "buidler deploy-Example",
|
||||
|
|
32
test/subgraph-scenarios.spec.ts
Normal file
32
test/subgraph-scenarios.spec.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import {configuration as actionsConfiguration} from './helpers/actions';
|
||||
import {configuration as calculationsConfiguration} from './helpers/utils/calculations';
|
||||
|
||||
import BigNumber from 'bignumber.js';
|
||||
import {makeSuite} from './helpers/make-suite';
|
||||
import {getReservesConfigByPool} from '../helpers/configuration';
|
||||
import {AavePools, iAavePoolAssets, IReserveParams} from '../helpers/types';
|
||||
import {executeStory} from './helpers/scenario-engine';
|
||||
|
||||
makeSuite('Subgraph scenario tests', async (testEnv) => {
|
||||
let story: any;
|
||||
let scenario;
|
||||
before('Initializing configuration', async () => {
|
||||
const scenario = require(`./helpers/scenarios/borrow-repay-stable`);
|
||||
story = scenario.stories[0];
|
||||
// Sets BigNumber for this suite, instead of globally
|
||||
BigNumber.config({DECIMAL_PLACES: 0, ROUNDING_MODE: BigNumber.ROUND_DOWN});
|
||||
|
||||
actionsConfiguration.skipIntegrityCheck = false; //set this to true to execute solidity-coverage
|
||||
|
||||
calculationsConfiguration.reservesParams = <iAavePoolAssets<IReserveParams>>(
|
||||
getReservesConfigByPool(AavePools.proto)
|
||||
);
|
||||
});
|
||||
after('Reset', () => {
|
||||
// Reset BigNumber
|
||||
BigNumber.config({DECIMAL_PLACES: 20, ROUNDING_MODE: BigNumber.ROUND_HALF_UP});
|
||||
});
|
||||
it('deposit-borrow', async () => {
|
||||
await executeStory(story, testEnv);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user