UNPKG

978 BJavaScriptView Raw
1'use strict';
2const debug = require('debug')('ember-try:commands:try-each');
3
4module.exports = {
5 name: 'try:each',
6 description:
7 'Runs each of the dependency scenarios specified in config with the specified command. The command defaults to `ember test`',
8 works: 'insideProject',
9
10 availableOptions: [
11 { name: 'skip-cleanup', type: Boolean, default: false },
12 { name: 'config-path', type: String },
13 ],
14
15 _getConfig: require('../utils/config'),
16 _TryEachTask: require('../tasks/try-each'),
17
18 async run(commandOptions) {
19 debug('Options:\n', commandOptions);
20
21 let config = await this._getConfig({
22 project: this.project,
23 configPath: commandOptions.configPath,
24 });
25
26 debug('Config: %s', JSON.stringify(config));
27
28 let tryEachTask = new this._TryEachTask({
29 ui: this.ui,
30 project: this.project,
31 config,
32 });
33
34 return await tryEachTask.run(config.scenarios, { skipCleanup: commandOptions.skipCleanup });
35 },
36};