I've been working on a pallet in isolation for a few months. I did testing by mocking a runtime and mocking the related pallets that are expected by it. Basically, so far I have created fake pallets in a
mock directory and used those in place of the ones that my pallet expects to be loosely coupled with. Here's my directory structure (roughly)
frame/my-pallet/ ├── Cargo.toml └── src ├── benchmarking.rs ├── lib.rs ├── mock │ ├── accounts.rs │ ├── assets.rs │ ├── mod.rs │ ├── pallet1.rs │ ├── pallet2.rs │ └── runtime.rs ├── tests │ ├── mod.rs │ ├── extrinsic1.rs │ ├── extrinsic2.rs │ └── extrinsic3.rs ├── helpers.rs └── weights.rs
I now wanna do tests with a real implementation of
pallet1, but I wanna keep the test cases with the mocked version. Is there a 'canonical' way of doing that? I'm considering just adding a
integrations subdirectory under
src and having new
tests.rs files there.