The truffle build system uses a different artifacts directory for compiling (a) and testing (b). We prepand a custom flattening step.
Implicit yarn flatten
flattens contracts from ./contracts
into ./build/flattened
.
yarn build
compiles contracts from ./build/flattened
into ./build/contracts
.
yarn test
compiles contracts from ./build/flattened
into a temporary folder.