Custom Builds and Unit Testing

I'd like to use Karma and Jasmine to Unit Test my code. I'd like to watch the source directory for changes and have Karma automagically run my unit tests as I work. What is the best strategy for accomplishing this?

I've been looking at the deploy script, thinking that I might try to compile only certain portions of my application as I go with a custom build script (I don't need to build the enyo core library EVERY time), but I haven't had much luck. I don't want to write a ton of custom solutions if enyo has existing tools or the means to do this already.

Any suggestions for the optimal work flow?

Thanks,
Michael

Comments

  • Hi Jelly,

    Internally we use Mocha for our unit testing. In the current master branch and earlier we used grunt as a test runner. You can see what we've done in tools/mocha-test directory.

    In the future, we will be migrating to gulp for our testing and we'll have additional tooling around building (and watching) source for testing.

    That said, we don't have any particular recommendations around building the app output for testing. For 2.5 we do recommend using Bootplate as an app template and using the supplied build scripts to produce output.

    I would suggest creating a gulp or grunt task that watches your source and produces the output app using those scripts for testing. There are a lot of modules for both gulp and grunt that will help.

    Let me know if you need additional information.

    Roy
  • Thanks RoySutton, I'll let you know if I do. :)
Sign In or Register to comment.