blockchainmove-langsui

How to fix the error "error[E03002]: unbound module" when I run "sui move test" in the terminal?


When I run "sui move test" in my move package folder I receive the following error in the terminal:

error[E03002]: unbound module
    ┌─ ./sources/bet.tests.move:504:13
    │
504 │             ts::return_shared(bet_val);
    │             ^^ Unbound module alias 'ts'

What does this error mean and how can I fix it?


Solution

  • You should import the test_scenario module from the sui framework package as the alias "ts" at the start of your module.

    use sui::test_scenario::{Self as ts};