Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Elegant way to create separate DARs for building and testing?Forum ↗

Elegant way to create separate DARs for building and testing?

App Development2 posts601 views10 likesLast activity Apr 2020
RI
Richard_KapolnaiOP
Apr 2020

We have a test scenario/script where we a simple template, which we don’t want to load when the DAR is loaded on the ledger.
What is the recommended way to have a business.dar to contain only business templates and to build a separate test.dar to run the tests? Maybe using business.dar as a module in the test.dar? Or simply build them slightly differently to exclude/include test dir?

CO
cocreature
Apr 2020

The most robust and cleanest solution is to have two projects, one for your actual code and then a separate project for your tests that depends on the DAR of the main project via dependencies.
However, that can be a bit inconvenient for testing so there are some ways around that by making use of the source field. I’ve described that approach in How to build dars but not include scenarios?.

← Back to Discussions