yeoman / generator-karma

Yeoman generator for Karma
http://yeoman.io
BSD 2-Clause "Simplified" License
172 stars 48 forks source link

Add option to support multiple frameworks #72

Closed tomwayson closed 9 years ago

tomwayson commented 9 years ago

I see that this has been asked for before, and it seems relatively simple. I'm glad to make a PR, but wanted to validate my thinking first.

1) option: --other-frameworks=requirejs,sinon (is this a good name for the option?) 2) Update this line (and corresponding line in coffee template) to something like:

    // testing framework to use (jasmine/mocha/qunit/...)
    // and any additional frameworks in use (if any)
    frameworks: ['<%= options["test-framework"] %>' <%if (options["other-frameworks"]) { %>, <%= templateArray(options["other-frameworks"]]) %><% }%>],

3) Update test accordingly

Anything I'm missing?

SBoudrias commented 9 years ago

That plan looks good! PR welcomed!

eddiemonge commented 9 years ago

you could change test-framework to accept an array or a string so it stays backwards compatible. Maybe even a csv string and check for commas or use the value

SBoudrias commented 9 years ago

I wouldn't stress about backward compatibility, it's a fairly simple change to make in existing generators.