Context:
I am trying to detach end-to-end tests from my main contract lib.rs
. I created a new module in tests_e2e.rs
.
I import the module in main contract like so:
lib.rs
...vvv
#[cfg(all(test, feature = "e2e-tests"))]
mod tests_e2e;
In the tests_e2e.rs
file, I have the usual module defined for ink_e2e tests, but with the obvious addition of the crate import (named ilockmvp
):
tests_e2e.rs
...vvv
pub mod e2e_tests {
use crate::ilockmvp::*;
use ink_e2e::{
build_message,
CallResult,
};
use openbrush::contracts::psp22::psp22_external::PSP22;
use ink::primitives::{
Clear,
Hash,
};
When I build test with cargo +nightly test --features e2e-tests -- --show-output
I get this error:
When I remove the crate import, no such error occurs, but the obvious error that I need to import things ensues.
Question:
How do I work around this? --thoughts/suggestions/insights?
***** I got this working fine for my #[ink::test]
unit tests in a different module file (tests_unit.rs
).