Skip to content

Commit

Permalink
chore: add cosmos examples test
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Dec 7, 2023
1 parent 33755ca commit 64691f7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
9 changes: 6 additions & 3 deletions config/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"aptos": {
"enabled": true
}
"aptos": {
"enabled": true
},
"cosmos": {
"enabled": false
}
}
2 changes: 1 addition & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"enabled": false
},
"cosmos": {
"enabled": true
"enabled": false
}
}
26 changes: 25 additions & 1 deletion examples/tests/checkExamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

require('dotenv').config();

const { start, deploy, executeEVMExample, executeAptosExample, getWallet, getEVMChains, relayers } = require('../../scripts/libs');
const {
start,
deploy,
executeEVMExample,
executeAptosExample,
getWallet,
getEVMChains,
relayers,
executeCosmosExample,
} = require('../../scripts/libs');
const {
destroyExported,
utils: { setLogger },
Expand Down Expand Up @@ -31,6 +40,8 @@ const examples = [

const aptosExamples = ['call-contract', 'token-linker'];

const cosmosExamples = ['call-contract'];

describe('Check Examples Execution', function () {
// marked as slow if it takes longer than 15 seconds to run each test.
const wallet = getWallet();
Expand Down Expand Up @@ -78,4 +89,17 @@ describe('Check Examples Execution', function () {
});
}
});

describe('Cosmos Examples', function () {
for (const exampleName of cosmosExamples) {
it(exampleName, async function () {
const example = rootRequire(`examples/cosmos/${exampleName}/index.js`);
const chains = getEVMChains('local', testChains);

if (example.deploy) await deploy('local', chains, wallet, example);

await executeCosmosExample('local', chains, [], wallet, example);
});
}
});
});

0 comments on commit 64691f7

Please sign in to comment.