Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aemil145 committed Feb 23, 2022
1 parent 0bad67b commit 3c177e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 35 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ blast unittest -q
---
## Testing contracts with JavaScript

You can test your smart contracts using `.js` files in `{project_root}/tests/` folder. You can use the provided sample test as a template or make one or more tests of your own. You must have a [local node running](#starting-a-local-node) in order to deploy or interact with the smart contracts in your tests.
Cudos Blast uses [Jest](https://jestjs.io) framework for testing. Test files must be in `{project_root}/tests/` folder. You can use the provided sample test as a template or make one or more tests of your own. You must have a [local node running](#starting-a-local-node) in order to deploy or interact with the smart contracts in your tests.

```bash
describe('alpha contract', () => {
Expand All @@ -134,7 +134,7 @@ describe('alpha contract', () => {

let alice, bob, contract

// deploying alpha contract before each test case
// deploying alpha contract once before test cases
beforeAll(async () => {
// function 'getSigners' is available in global context
[alice, bob] = await getSigners()
Expand Down
13 changes: 13 additions & 0 deletions template/integration_tests/alpha.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
describe('alpha test', async function () {
const alphaContract = await getContractFactory('alpha', {
count: 13
})
const contractAddress = await alphaContract.deploy()
const _alphaContract = await getContractFromAddress(contractAddress)
const {
count
} = await alphaContract.querySmart({
get_count: {}
})
expect(count).to.equal(14)
})
33 changes: 0 additions & 33 deletions template/tests/alpha.test.js

This file was deleted.

0 comments on commit 3c177e6

Please sign in to comment.