ic-repl icon indicating copy to clipboard operation
ic-repl copied to clipboard

Try-catch-finally

Open jzxchiang1 opened this issue 2 years ago • 1 comments

I'd like the ability to try-catch-finally over my asserts so that at the very end I can stop and delete my test canister, regardless of whether all of the asserts passed or not.

Right now, if my tests failed, my test canister (which I created at the top of my ic-repl script) doesn't get cleaned up.

jzxchiang1 avatar Mar 26 '22 18:03 jzxchiang1

I'm experimenting to see how far we can go without any control flow :)

For your use case, we can refactor the script into three separate files: 1) creating canisters; 2) testing; 3) clean up. At the end of the first script, you can use export "env.sh" to export all variables you have defined. Script 2 and 3 will load "env.sh" at the start to resume the work from 1.

chenyan2002 avatar Mar 26 '22 20:03 chenyan2002