fallbacks.js 960 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*global describe, before, it */
  2. var path = require('path');
  3. var assert = require('assert');
  4. var generators = require('..');
  5. var helpers = generators.test;
  6. describe('generators config', function () {
  7. describe('when config("generators.test-framework") is set', function () {
  8. before(function () {
  9. this.env = generators().register(function () {}, 'ember:model');
  10. });
  11. it('I get the appropriate generator.options', function () {
  12. var generator = this.env.create('ember:model', {
  13. args: ['hey'],
  14. options: {
  15. generator: {
  16. 'test-framework': 'jasmine'
  17. }
  18. }
  19. });
  20. assert.equal(generator.options['test-framework'], 'jasmine');
  21. generator = new generators.Base({
  22. env: this.env,
  23. resolved: 'test',
  24. generator: {
  25. 'test-framework': 'mocha'
  26. }
  27. });
  28. assert.equal(generator.options['test-framework'], 'mocha');
  29. });
  30. });
  31. });