Skip to content
Discussion options

You must be logged in to vote

You cannot use aptos move test for your deposit_and_withdraw script function. Unlike modules, scripts cannot declare structs, friends, or have persistent storage, and they cannot be directly unit tested using the aptos move test command.

You should write your unit tests using the #[test] attribute in your modules. You can then call invoke those test functions by using scripts (or just the CLI command). If you need to test the script's logic itself, you would typically do this using a testing framework in your backend (typescript/rust/python), or by observing behavior after deployment to testnet/devnet (this is more integration testing).

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@keyliaran
Comment options

@kshitijc1506
Comment options

Answer selected by kshitijc1506
@keyliaran
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
move-script Move script lets you call multiple functions in 1 tx
2 participants