MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / constructor

Method constructor

lib/broccoli/ember-addon.js:22–58  ·  view source on GitHub ↗

EmberAddon is used during addon development. @class EmberAddon @extends EmberApp @constructor @param {Object} [defaults] @param {Object} [options={}] Configuration options

(defaults, options)

Source from the content-addressed store, hash-verified

20 @param {Object} [options={}] Configuration options
21 */
22 constructor(defaults, options) {
23 if (arguments.length === 0) {
24 options = {};
25 } else if (arguments.length === 1) {
26 options = defaults;
27 } else {
28 defaultsDeep(options, defaults);
29 }
30
31 process.env.EMBER_ADDON_ENV = process.env.EMBER_ADDON_ENV || 'development';
32 let overrides = {
33 name: 'dummy',
34 configPath: './tests/dummy/config/environment',
35 trees: {
36 app: 'tests/dummy/app',
37 public: 'tests/dummy/public',
38 styles: 'tests/dummy/app/styles',
39 templates: 'tests/dummy/app/templates',
40 tests: new Funnel('tests', {
41 exclude: [/^dummy/],
42 }),
43 vendor: null,
44 },
45 };
46
47 if (!fs.existsSync('tests/dummy/app')) {
48 overrides.trees.app = null;
49 overrides.trees.styles = null;
50 overrides.trees.templates = null;
51 }
52
53 if (fs.existsSync('tests/dummy/vendor')) {
54 overrides.trees.vendor = 'tests/dummy/vendor';
55 }
56
57 super(defaultsDeep(options, overrides));
58 }
59}
60
61module.exports = EmberAddon;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected