#2798 JS Test Code

SlimerDude Mon 1 Jun

Just a thought - in the interests of streaming lining / minifying Fantom JS content delivery, perhaps Test code could be left out of the generated Fantom .js files?

I note that in particular the concurrent and graphics pods ship Test code in their .js files, so I assume the other core pods do too.

For instance, I see the following JS classes being delivered to the browser and many more:

  • fan.concurrent.ConcurrentMapTest
  • fan.concurrent.AtomicTest
  • fan.graphics.GeomTest
  • fan.graphics.FontTest

brian Mon 1 Jun

Its designed so you can do your builds with the stripTest build config property. Or set the FAN_BUILD_STRIPTEST=true environment variable. See BuildPod

SlimerDude Mon 1 Jun

Thanks Brian. Sure, I could re-compile the core pods myself from source...

...I was just thinking that typically one looks to minify JS files, and the Test classes will probably never be used in a prod environment or be tested in a Browser - so perhaps Fantom could look at excluding them from the core pods in future builds?

That way, anyone else looking to use Fantom in a web app doesn't have to re-compile their own distribution.

I understand this may go against the Fantom ethos of bundling test code in pods, but in the case of JS files, I don't see that much benefit in it.

brian Wed 1 Jul

I think we would need to make a decision to always have test code or never have test code in the build zip itself. And if we go never, then that would mean omitting testSys, testCompiler, etc.

I can see both arguments and don't have a strong preference myself. So would be interested in community feedback:

Option A: Include all test cases and test pods in build.zip (todays behavior)

Option B: Omit all test cases and test pods from build zip

Login or Signup to reply.