Skip to content

Commit

Permalink
Update Testing Framework docs for current version of Cadence (#213)
Browse files Browse the repository at this point in the history
* Update Testing Framework docs for current version of Cadence

* Add line break.

Co-authored-by: Supun Setunga <[email protected]>

* Prefix comment with `Invalid`

Co-authored-by: Supun Setunga <[email protected]>

* Add line break between comment and line of code

Co-authored-by: Supun Setunga <[email protected]>

* Use backticks for Cadence composite types

Co-authored-by: Supun Setunga <[email protected]>

* Use backticks for Cadence composite types

Co-authored-by: Supun Setunga <[email protected]>

---------

Co-authored-by: Supun Setunga <[email protected]>
  • Loading branch information
m-Peter and SupunS authored Aug 31, 2023
1 parent 225d38a commit 4dac0e0
Show file tree
Hide file tree
Showing 2 changed files with 898 additions and 141 deletions.
9 changes: 4 additions & 5 deletions docs/cadence/testing-framework.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,11 @@ access(all) fun testExample() {
## Matcher combinators

The built-in matchers, as well as custom matchers, can be combined with the three available combinators:

- `not`,
- `or`,
- `and`

in order to create more elaborate matchers and increase re-usability.

### not
Expand Down Expand Up @@ -625,7 +627,7 @@ access(all) struct Blockchain {
self.backend.commitBlock()
}
/// Executes a given transaction and commit the current block.
/// Executes a given transaction and commits the current block.
///
access(all) fun executeTransaction(_ tx: Transaction): TransactionResult {
self.addTransaction(tx)
Expand All @@ -634,7 +636,7 @@ access(all) struct Blockchain {
return txResult
}
/// Executes a given set of transactions and commit the current block.
/// Executes a given set of transactions and commits the current block.
///
access(all) fun executeTransactions(_ transactions: [Transaction]): [TransactionResult] {
for tx in transactions {
Expand Down Expand Up @@ -1276,9 +1278,6 @@ access(all) fun testExample() {
arguments: [],
)
// Executing the transaction immediately
// This may fail if the current block contains
// transactions that have not being executed yet.
let txResult = blockchain.executeTransaction(tx)
Test.expect(txResult, Test.beSucceeded())
Expand Down
Loading

1 comment on commit 4dac0e0

@vercel
Copy link

@vercel vercel bot commented on 4dac0e0 Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.