How to exclude some test code not unit test when exporting my project?

Hi, Good evening,

I am making a watchface. To check all the weather icons display, I use some code to mark current simulating as testMode,in which case the icon will switch back and forth based on a changing index and an icon name array.

Like below. I think if you are experienced, you will get the idea.

var weatherIndex = 0;

const keyArray = { "d" => ["01d","02d","03d","04d","09d","10d","11d", "13d","50d",], "n" => ["01n","02n","03n","04n","09n","10n","11n","13n","50n"] };

var testMode = true;

if(testMode){
weatherIndex = (weatherIndex + 1)%9;
iconText = smallIconDictionary[keyArray[Sys.getClockTime().hour > 6 && Sys.getClockTime().hour < 18?"d":"n"][weatherIndex]];
}
dc.drawText(x1, y1, weatherIconFont,iconText, 5 /* Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER */);
dc.drawText(x2, y2, smallCharFont,weatherDict["temperatureValue"], 5 /* Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER */);
But the array and the clause under if are useless for a release version(The main concern is space consumption), so how to exclude them when exporting my release? 
I think I can use an annotation to mark the array assignment and exclude the code in my jungle file. Are there better practices?
Any suggestions are welcome.