6. Writing a Test
Now we need to go __test__/hello_world.test.ts
and modify our test to properly call our contract.
We can do so by removing test("sum")
and test("difference")
and write our own test:
The important thing here is that await appClient.doMath
was changed to await appClient.hello
and the argument was changed to { name: "AlgoDev" }
. Finally, we changed the test to expect "Hello, AlgoDev"
since the argument we passed in was "AlgoDev"
.
Running The Test
To run the test, run the script npm run test
, which should show all tests passing: