diff --git a/crates/sui/src/client_commands.rs b/crates/sui/src/client_commands.rs index 2250324c7ab4e..0f474b8734e9c 100644 --- a/crates/sui/src/client_commands.rs +++ b/crates/sui/src/client_commands.rs @@ -734,11 +734,14 @@ impl SuiClientCommands { } => { if build_config.test_mode { return Err(SuiError::ModulePublishFailure { - error: "The `publish` subcommand should not be used with the `--test` flag\n\ - \n\ - Library code in published packages must not depend on test code.\n\ - In order to fix this and publish the package without `--test`, search for, and remove \ - instances of e.g. test modules declared as `friend`s of modules from `sources/`.".to_string(), + error: + "The `publish` subcommand should not be used with the `--test` flag\n\ + \n\ + Code in published packages must not depend on test code.\n\ + In order to fix this and publish the package without `--test`, \ + remove any non-test dependencies on test-only code.\n\ + You can ensure all test-only dependencies have been removed by \ + compiling the package normally with `sui move build`. ".to_string(), } .into()); } diff --git a/crates/sui/tests/cli_tests.rs b/crates/sui/tests/cli_tests.rs index 33630a135532e..21d5fe767d153 100644 --- a/crates/sui/tests/cli_tests.rs +++ b/crates/sui/tests/cli_tests.rs @@ -941,7 +941,7 @@ async fn test_package_publish_test_flag() -> Result<(), anyhow::Error> { let expect = expect![[r#" Err( ModulePublishFailure { - error: "The `publish` subcommand should not be used with the `--test` flag\n\nLibrary code in published packages must not depend on test code.\nIn order to fix this and publish the package without `--test`, search for, and remove instances of e.g. test modules declared as `friend`s of modules from `sources/`.", + error: "The `publish` subcommand should not be used with the `--test` flag\n\nCode in published packages must not depend on test code.\nIn order to fix this and publish the package without `--test`, remove any non-test dependencies on test-only code.\nYou can ensure all test-only dependencies have been removed by compiling the package normally with `sui move build`. ", }, ) "#]];