Skip to content

Commit

Permalink
Added setup method to pull in Recipe into test execution
Browse files Browse the repository at this point in the history
Updated flow.json to denote the deployed address for testing context
  • Loading branch information
franklywatson committed Dec 13, 2024
1 parent d85003f commit ad2d483
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
13 changes: 13 additions & 0 deletions cadence/tests/Recipe_test.cdc
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
import Test
import "test_helpers.cdc"


access(all)
fun setup() {
let err = Test.deployContract(
name: "Recipe",
path: "../contracts/Recipe.cdc",
arguments: [],
)

Test.expect(err, Test.beNil())
}

access(all) fun testExample() {
let array = [1, 2, 3]
Expand Down
9 changes: 6 additions & 3 deletions flow.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"Recipe": {
"source": "./cadence/contracts/Recipe.cdc",
"aliases": {
"emulator": "f8d6e0586b0a20c7"
"emulator": "f8d6e0586b0a20c7",
"testing": "0000000000000007"
}
}
},
Expand Down Expand Up @@ -77,7 +78,8 @@
"aliases": {
"emulator": "f8d6e0586b0a20c7",
"mainnet": "0b2a3299cc857e29",
"testnet": "877931736ee77cff"
"testnet": "877931736ee77cff",
"testing": "0000000000000007"
}
},
"TopShotLocking": {
Expand All @@ -86,7 +88,8 @@
"aliases": {
"emulator": "f8d6e0586b0a20c7",
"mainnet": "0b2a3299cc857e29",
"testnet": "877931736ee77cff"
"testnet": "877931736ee77cff",
"testing": "0000000000000007"
}
},
"ViewResolver": {
Expand Down

0 comments on commit ad2d483

Please sign in to comment.