From bda3dce816b2e20312efc473016376a91757b731 Mon Sep 17 00:00:00 2001 From: Bert De Block Date: Wed, 29 Jan 2025 11:04:39 +0100 Subject: [PATCH] Move logic out of `ember-cli` commands --- index.js | 8 +- lib/commands/config.js | 23 --- lib/commands/config.mjs | 8 + lib/commands/reset.js | 20 --- lib/commands/reset.mjs | 9 ++ lib/commands/try-each.js | 36 ----- lib/commands/try-each.mjs | 17 +++ lib/commands/try-ember.js | 45 ------ lib/commands/try-ember.mjs | 23 +++ lib/commands/try-one.js | 72 --------- lib/commands/try-one.mjs | 39 +++++ lib/ember-cli-commands/config.js | 14 ++ lib/{commands => ember-cli-commands}/index.js | 0 lib/ember-cli-commands/reset.js | 14 ++ lib/ember-cli-commands/try-each.js | 19 +++ lib/ember-cli-commands/try-ember.js | 21 +++ lib/ember-cli-commands/try-one.js | 21 +++ test/commands/try-each-test.js | 49 ++----- test/commands/try-ember-test.js | 69 +++------ test/commands/try-one-test.js | 137 +++++++++--------- 20 files changed, 297 insertions(+), 347 deletions(-) delete mode 100644 lib/commands/config.js create mode 100644 lib/commands/config.mjs delete mode 100644 lib/commands/reset.js create mode 100644 lib/commands/reset.mjs delete mode 100644 lib/commands/try-each.js create mode 100644 lib/commands/try-each.mjs delete mode 100644 lib/commands/try-ember.js create mode 100644 lib/commands/try-ember.mjs delete mode 100644 lib/commands/try-one.js create mode 100644 lib/commands/try-one.mjs create mode 100644 lib/ember-cli-commands/config.js rename lib/{commands => ember-cli-commands}/index.js (100%) create mode 100644 lib/ember-cli-commands/reset.js create mode 100644 lib/ember-cli-commands/try-each.js create mode 100644 lib/ember-cli-commands/try-ember.js create mode 100644 lib/ember-cli-commands/try-one.js diff --git a/index.js b/index.js index 8ee9fa4d..5d106361 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,12 @@ module.exports = { name: 'ember-try', includedCommands() { - return require('./lib/commands'); + return { + 'try:config': require('./lib/ember-cli-commands/config'), + 'try:each': require('./lib/ember-cli-commands/try-each'), + 'try:ember': require('./lib/ember-cli-commands/try-ember'), + 'try:one': require('./lib/ember-cli-commands/try-one'), + 'try:reset': require('./lib/ember-cli-commands/reset'), + }; }, }; diff --git a/lib/commands/config.js b/lib/commands/config.js deleted file mode 100644 index df31f173..00000000 --- a/lib/commands/config.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const debug = require('debug')('ember-try:commands:config'); -const { log } = require('../utils/console'); - -module.exports = { - name: 'try:config', - description: 'Displays the config that will be used', - works: 'insideProject', - availableOptions: [{ name: 'config-path', type: String }], - - async run(commandOptions) { - debug('Options:\n', commandOptions); - - let cwd = this.project.root; - let config = await require('../utils/config')({ - configPath: commandOptions.configPath, - cwd, - }); - - log(JSON.stringify(config, null, 2)); - }, -}; diff --git a/lib/commands/config.mjs b/lib/commands/config.mjs new file mode 100644 index 00000000..b2cb59e3 --- /dev/null +++ b/lib/commands/config.mjs @@ -0,0 +1,8 @@ +import getConfig from '../utils/config.js'; +import { log } from '../utils/console.js'; + +export async function config({ configPath, cwd }) { + const config = await getConfig({ configPath, cwd }); + + log(JSON.stringify(config, null, 2)); +} diff --git a/lib/commands/reset.js b/lib/commands/reset.js deleted file mode 100644 index e1c2fa3b..00000000 --- a/lib/commands/reset.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -module.exports = { - name: 'try:reset', - description: 'Resets dependencies to their committed state. For when things get messy.', - works: 'insideProject', - - async run() { - let cwd = this.project.root; - let config = await require('../utils/config')({ cwd }); - let ResetTask = require('../tasks/reset'); - - let resetTask = new ResetTask({ - config, - cwd, - }); - - return await resetTask.run(); - }, -}; diff --git a/lib/commands/reset.mjs b/lib/commands/reset.mjs new file mode 100644 index 00000000..c057fa0f --- /dev/null +++ b/lib/commands/reset.mjs @@ -0,0 +1,9 @@ +import ResetTask from '../tasks/reset.js'; +import getConfig from '../utils/config.js'; + +export async function reset({ configPath, cwd }) { + const config = await getConfig({ configPath, cwd }); + const resetTask = new ResetTask({ config, cwd }); + + await resetTask.run(); +} diff --git a/lib/commands/try-each.js b/lib/commands/try-each.js deleted file mode 100644 index 6b7646f9..00000000 --- a/lib/commands/try-each.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; -const debug = require('debug')('ember-try:commands:try-each'); - -module.exports = { - name: 'try:each', - description: - 'Runs each of the dependency scenarios specified in config with the specified command. The command defaults to `ember test`', - works: 'insideProject', - - availableOptions: [ - { name: 'skip-cleanup', type: Boolean, default: false }, - { name: 'config-path', type: String }, - ], - - _getConfig: require('../utils/config'), - _TryEachTask: require('../tasks/try-each'), - - async run(commandOptions) { - debug('Options:\n', commandOptions); - - let cwd = this.project.root; - let config = await this._getConfig({ - configPath: commandOptions.configPath, - cwd, - }); - - debug('Config: %s', JSON.stringify(config)); - - let tryEachTask = new this._TryEachTask({ - config, - cwd, - }); - - return await tryEachTask.run(config.scenarios, { skipCleanup: commandOptions.skipCleanup }); - }, -}; diff --git a/lib/commands/try-each.mjs b/lib/commands/try-each.mjs new file mode 100644 index 00000000..e93582de --- /dev/null +++ b/lib/commands/try-each.mjs @@ -0,0 +1,17 @@ +import TryEachTask from '../tasks/try-each.js'; +import getConfig from '../utils/config.js'; + +export async function tryEach({ + configPath, + cwd, + skipCleanup, + + // For testing purposes: + _getConfig = getConfig, + _TryEachTask = TryEachTask, +}) { + const config = await _getConfig({ configPath, cwd }); + const tryEachTask = new _TryEachTask({ config, cwd }); + + await tryEachTask.run(config.scenarios, { skipCleanup }); +} diff --git a/lib/commands/try-ember.js b/lib/commands/try-ember.js deleted file mode 100644 index ff3b3f2f..00000000 --- a/lib/commands/try-ember.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -const debug = require('debug')('ember-try:commands:try-ember'); - -module.exports = { - name: 'try:ember', - description: - 'Runs with each Ember version matching the semver statement given. The command defaults to `ember test`', - works: 'insideProject', - - anonymousOptions: [''], - - availableOptions: [ - { name: 'skip-cleanup', type: Boolean, default: false }, - { name: 'config-path', type: String }, - ], - - _getConfig: require('../utils/config'), - _TryEachTask: require('../tasks/try-each'), - - async run(commandOptions, rawArgs) { - let emberVersion = rawArgs[0]; - - debug('Options:\n', commandOptions); - debug('Ember semver statement', emberVersion); - - let cwd = this.project.root; - let config = await this._getConfig({ - configPath: commandOptions.configPath, - cwd, - versionCompatibility: { - ember: emberVersion, - }, - }); - - debug('Config: %s', JSON.stringify(config)); - - let tryEachTask = new this._TryEachTask({ - config, - cwd, - }); - - return await tryEachTask.run(config.scenarios, { skipCleanup: commandOptions.skipCleanup }); - }, -}; diff --git a/lib/commands/try-ember.mjs b/lib/commands/try-ember.mjs new file mode 100644 index 00000000..c1697e34 --- /dev/null +++ b/lib/commands/try-ember.mjs @@ -0,0 +1,23 @@ +import TryEachTask from '../tasks/try-each.js'; +import getConfig from '../utils/config.js'; + +export async function tryEmber({ + configPath, + cwd, + ember, + skipCleanup, + + // For testing purposes: + _getConfig = getConfig, + _TryEachTask = TryEachTask, +}) { + const config = await _getConfig({ + configPath, + cwd, + versionCompatibility: { ember }, + }); + + const tryEachTask = new _TryEachTask({ config, cwd }); + + await tryEachTask.run(config.scenarios, { skipCleanup }); +} diff --git a/lib/commands/try-one.js b/lib/commands/try-one.js deleted file mode 100644 index 1c0e1532..00000000 --- a/lib/commands/try-one.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -const debug = require('debug')('ember-try:commands:try-one'); - -module.exports = { - name: 'try:one', - description: - 'Run any `ember` command with the specified dependency scenario. This optional command is preceded by " --- " and will default to `ember test`', - works: 'insideProject', - - anonymousOptions: [''], - - availableOptions: [ - { name: 'skip-cleanup', type: Boolean, default: false }, - { name: 'config-path', type: String }, - ], - - _getConfig: require('../utils/config'), - _TryEachTask: require('../tasks/try-each'), - - getCommand(_argv) { - let args = (_argv || this._commandLineArguments()).slice(); - let separatorIndex = args.indexOf('---'); - if (separatorIndex === -1) { - return []; - } - - return args.slice(separatorIndex + 1); - }, - - async run(commandOptions, rawArgs) { - let scenarioName = rawArgs[0]; - - debug('Scenario argument: %s', scenarioName); - debug('Command options:\n', commandOptions); - - let commandArgs = this.getCommand(); - - debug('Command specified on command line: %s', commandArgs.join(' ')); - - if (!scenarioName) { - throw new Error('The `ember try:one` command requires a ' + 'scenario name to be specified.'); - } - - let cwd = this.project.root; - let config = await this._getConfig({ - configPath: commandOptions.configPath, - cwd, - }); - - debug('Config: %s', JSON.stringify(config)); - - let scenario = config.scenarios.find((s) => s.name === scenarioName); - if (!scenario) { - throw new Error( - 'The `ember try:one` command requires a scenario ' + 'specified in the config.', - ); - } - - let tryEachTask = new this._TryEachTask({ - commandArgs, - config, - cwd, - }); - - return await tryEachTask.run([scenario], { skipCleanup: commandOptions.skipCleanup }); - }, - - _commandLineArguments() { - return process.argv; - }, -}; diff --git a/lib/commands/try-one.mjs b/lib/commands/try-one.mjs new file mode 100644 index 00000000..e19d569b --- /dev/null +++ b/lib/commands/try-one.mjs @@ -0,0 +1,39 @@ +import TryEachTask from '../tasks/try-each.js'; +import getConfig from '../utils/config.js'; + +export async function tryOne({ + configPath, + cwd, + scenarioName, + skipCleanup, + + // For testing purposes: + _args = process.argv, + _getConfig = getConfig, + _TryEachTask = TryEachTask, +}) { + const config = await _getConfig({ configPath, cwd }); + const scenario = config.scenarios.find((s) => s.name === scenarioName); + + if (scenario === undefined) { + throw new Error('The `try:one` command requires a scenario name specified in the config.'); + } + + const tryEachTask = new _TryEachTask({ + commandArgs: getCommandArgs(_args), + config, + cwd, + }); + + await tryEachTask.run([scenario], { skipCleanup }); +} + +export function getCommandArgs(args) { + const separatorIndex = args.indexOf('---'); + + if (separatorIndex === -1) { + return []; + } else { + return args.slice(separatorIndex + 1); + } +} diff --git a/lib/ember-cli-commands/config.js b/lib/ember-cli-commands/config.js new file mode 100644 index 00000000..8f23b617 --- /dev/null +++ b/lib/ember-cli-commands/config.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = { + name: 'try:config', + description: 'Displays the config that will be used', + works: 'insideProject', + availableOptions: [{ name: 'config-path', type: String }], + + async run({ configPath }) { + const { config } = await import('../commands/config.mjs'); + + await config({ configPath, cwd: this.project.root }); + }, +}; diff --git a/lib/commands/index.js b/lib/ember-cli-commands/index.js similarity index 100% rename from lib/commands/index.js rename to lib/ember-cli-commands/index.js diff --git a/lib/ember-cli-commands/reset.js b/lib/ember-cli-commands/reset.js new file mode 100644 index 00000000..f4698d0a --- /dev/null +++ b/lib/ember-cli-commands/reset.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = { + name: 'try:reset', + description: 'Resets dependencies to their committed state. For when things get messy.', + works: 'insideProject', + availableOptions: [{ name: 'config-path', type: String }], + + async run({ configPath }) { + const { reset } = await import('../commands/reset.mjs'); + + await reset({ configPath, cwd: this.project.root }); + }, +}; diff --git a/lib/ember-cli-commands/try-each.js b/lib/ember-cli-commands/try-each.js new file mode 100644 index 00000000..33fc3a20 --- /dev/null +++ b/lib/ember-cli-commands/try-each.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = { + name: 'try:each', + description: + 'Runs each of the dependency scenarios specified in config with the specified command. The command defaults to `ember test`', + works: 'insideProject', + + availableOptions: [ + { name: 'config-path', type: String }, + { name: 'skip-cleanup', type: Boolean, default: false }, + ], + + async run({ configPath, skipCleanup }) { + const { tryEach } = await import('../commands/try-each.mjs'); + + await tryEach({ configPath, cwd: this.project.root, skipCleanup }); + }, +}; diff --git a/lib/ember-cli-commands/try-ember.js b/lib/ember-cli-commands/try-ember.js new file mode 100644 index 00000000..b3d3d508 --- /dev/null +++ b/lib/ember-cli-commands/try-ember.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = { + name: 'try:ember', + description: + 'Runs with each Ember version matching the semver statement given. The command defaults to `ember test`', + works: 'insideProject', + + anonymousOptions: [''], + + availableOptions: [ + { name: 'config-path', type: String }, + { name: 'skip-cleanup', type: Boolean, default: false }, + ], + + async run({ configPath, skipCleanup }, [ember]) { + const { tryEmber } = await import('../commands/try-ember.mjs'); + + await tryEmber({ configPath, cwd: this.project.root, ember, skipCleanup }); + }, +}; diff --git a/lib/ember-cli-commands/try-one.js b/lib/ember-cli-commands/try-one.js new file mode 100644 index 00000000..645b938b --- /dev/null +++ b/lib/ember-cli-commands/try-one.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = { + name: 'try:one', + description: + 'Run any `ember` command with the specified dependency scenario. This optional command is preceded by " --- " and will default to `ember test`', + works: 'insideProject', + + anonymousOptions: [''], + + availableOptions: [ + { name: 'config-path', type: String }, + { name: 'skip-cleanup', type: Boolean, default: false }, + ], + + async run({ configPath, skipCleanup }, [scenarioName]) { + const { tryOne } = await import('../commands/try-one.mjs'); + + await tryOne({ configPath, cwd: this.project.root, scenarioName, skipCleanup }); + }, +}; diff --git a/test/commands/try-each-test.js b/test/commands/try-each-test.js index bbfa13e3..d8c2f711 100644 --- a/test/commands/try-each-test.js +++ b/test/commands/try-each-test.js @@ -1,44 +1,27 @@ import { expect } from 'chai'; -import TryEachCommand from '../../lib/commands/try-each.js'; - -const origTryEachTask = TryEachCommand._TryEachTask; -const origGetConfig = TryEachCommand._getConfig; +import { tryEach } from '../../lib/commands/try-each.mjs'; describe('commands/try-each', () => { - describe('#run', () => { - let mockConfig; - - function MockTryEachTask() {} - MockTryEachTask.prototype.run = function () {}; + it('passes the correct options to `getConfig`', async () => { + let getConfigOptions; - beforeEach(() => { - TryEachCommand.project = { root: '' }; + await tryEach({ + configPath: 'foo/bar/widget.js', + cwd: 'foo', - TryEachCommand._getConfig = function () { - return Promise.resolve(mockConfig || { scenarios: [] }); - }; + _getConfig: (options) => { + getConfigOptions = options; - TryEachCommand._TryEachTask = MockTryEachTask; + return { scenarios: [{ name: 'default' }] }; + }, + _TryEachTask: class { + run() {} + }, }); - afterEach(() => { - delete TryEachCommand.project; - - TryEachCommand._TryEachTask = origTryEachTask; - TryEachCommand._getConfig = origGetConfig; - mockConfig = null; - }); - - it('passes the configPath to _getConfig', () => { - let configPath; - TryEachCommand._getConfig = function (options) { - configPath = options.configPath; - - return Promise.resolve({ scenarios: [{ name: 'foo' }] }); - }; - - TryEachCommand.run({ configPath: 'foo/bar/widget.js' }, ['foo']); - expect(configPath).to.equal('foo/bar/widget.js'); + expect(getConfigOptions).to.deep.equal({ + configPath: 'foo/bar/widget.js', + cwd: 'foo', }); }); }); diff --git a/test/commands/try-ember-test.js b/test/commands/try-ember-test.js index 356a62ae..38c5f678 100644 --- a/test/commands/try-ember-test.js +++ b/test/commands/try-ember-test.js @@ -1,56 +1,29 @@ import { expect } from 'chai'; -import TryEmberCommand from '../../lib/commands/try-ember.js'; - -const origTryEachTask = TryEmberCommand._TryEachTask; -const origGetConfig = TryEmberCommand._getConfig; +import { tryEmber } from '../../lib/commands/try-ember.mjs'; describe('commands/try-ember', () => { - describe('#run', () => { - let mockConfig; - - function MockTryEachTask() {} - MockTryEachTask.prototype.run = function () {}; - - beforeEach(() => { - TryEmberCommand.project = { root: '' }; - - TryEmberCommand._getConfig = function () { - return Promise.resolve(mockConfig || { scenarios: [] }); - }; - - TryEmberCommand._TryEachTask = MockTryEachTask; - }); - - afterEach(() => { - delete TryEmberCommand.project; - - TryEmberCommand._TryEachTask = origTryEachTask; - TryEmberCommand._getConfig = origGetConfig; - mockConfig = null; + it('passes the correct options to `getConfig`', async () => { + let getConfigOptions; + + await tryEmber({ + configPath: 'foo/bar/widget.js', + cwd: 'foo', + ember: '1.13.0', + + _getConfig: (options) => { + getConfigOptions = options; + + return { scenarios: [{ name: 'default' }] }; + }, + _TryEachTask: class { + run() {} + }, }); - it('passes the configPath to _getConfig', () => { - let configPath; - TryEmberCommand._getConfig = function (options) { - configPath = options.configPath; - - return Promise.resolve({ scenarios: [{ name: 'foo' }] }); - }; - - TryEmberCommand.run({ configPath: 'foo/bar/widget.js' }, ['foo']); - expect(configPath).to.equal('foo/bar/widget.js'); - }); - - it('passes ember semver statement to _getConfig', () => { - let versionCompatibility; - TryEmberCommand._getConfig = function (options) { - versionCompatibility = options.versionCompatibility; - - return Promise.resolve({ scenarios: [{ name: 'foo' }] }); - }; - - TryEmberCommand.run({}, ['1.13.0']); - expect(versionCompatibility).to.eql({ ember: '1.13.0' }); + expect(getConfigOptions).to.deep.equal({ + configPath: 'foo/bar/widget.js', + cwd: 'foo', + versionCompatibility: { ember: '1.13.0' }, }); }); }); diff --git a/test/commands/try-one-test.js b/test/commands/try-one-test.js index 80b5605a..1bdd775f 100644 --- a/test/commands/try-one-test.js +++ b/test/commands/try-one-test.js @@ -1,13 +1,10 @@ import { expect } from 'chai'; -import TryOneCommand from '../../lib/commands/try-one.js'; - -const origTryEachTask = TryOneCommand._TryEachTask; -const origGetConfig = TryOneCommand._getConfig; +import { getCommandArgs, tryOne } from '../../lib/commands/try-one.mjs'; describe('commands/try-one', () => { - describe('getCommand', () => { - it('returns args after --- as command args', () => { - let args = TryOneCommand.getCommand([ + describe('getCommandArgs', () => { + it('returns args after `---` as command args', () => { + const args = getCommandArgs([ 'ember', 'try:one', 'foo-bar-scenario', @@ -16,72 +13,79 @@ describe('commands/try-one', () => { 'ember', 'build', ]); - expect(args).to.eql(['ember', 'build']); - }); - it('returns no command args if no ---', () => { - let args = TryOneCommand.getCommand([ - 'ember', - 'try:one', - 'foo-bar-scenario', - '--skip-cleanup', - ]); - expect(args).to.eql([]); + expect(args).to.deep.equal(['ember', 'build']); }); - }); - - describe('#run', () => { - let mockConfig; - function MockTryEachTask() {} - MockTryEachTask.prototype.run = function () {}; + it('returns no command args if no `---`', () => { + const args = getCommandArgs(['ember', 'try:one', 'foo-bar-scenario', '--skip-cleanup']); - beforeEach(() => { - TryOneCommand.project = { root: '' }; - - TryOneCommand._getConfig = function () { - return Promise.resolve(mockConfig || { scenarios: [] }); - }; - - TryOneCommand._TryEachTask = MockTryEachTask; + expect(args).to.deep.equal([]); }); + }); - afterEach(() => { - delete TryOneCommand.project; + describe('run', () => { + it('throws if no scenario name is provided', async () => { + let error; + + try { + await tryOne({ + _getConfig: () => ({ scenarios: [{ name: 'default' }] }), + _TryEachTask: class { + run() {} + }, + }); + } catch (e) { + error = e; + } - TryOneCommand._TryEachTask = origTryEachTask; - TryOneCommand._getConfig = origGetConfig; - mockConfig = null; + expect(error.message).to.equal( + 'The `try:one` command requires a scenario name specified in the config.', + ); }); - it('throws if no scenario is provided', async () => { + it('throws if no scenario is found for the provided scenario name', async () => { let error; try { - await TryOneCommand.run({}, []); + await tryOne({ + scenarioName: 'foo', + + _getConfig: () => ({ scenarios: [{ name: 'default' }] }), + _TryEachTask: class { + run() {} + }, + }); } catch (e) { error = e; } - expect(error.message).to.include('requires a scenario name to be specified'); + expect(error.message).to.equal( + 'The `try:one` command requires a scenario name specified in the config.', + ); }); - it('passes the configPath to _getConfig', async () => { - let configPath; - TryOneCommand._getConfig = async function (options) { - configPath = options.configPath; + it('passes the correct options to `getConfig`', async () => { + let getConfigOptions; - return { scenarios: [{ name: 'foo' }] }; - }; + await tryOne({ + configPath: 'foo/bar/widget.js', + cwd: 'foo', + scenarioName: 'default', - await TryOneCommand.run({ configPath: 'foo/bar/widget.js' }, ['foo']); + _getConfig: (options) => { + getConfigOptions = options; - expect(configPath).to.equal('foo/bar/widget.js'); - }); + return { scenarios: [{ name: 'default' }] }; + }, + _TryEachTask: class { + run() {} + }, + }); - it('throws if a scenario was not found for the scenarioName provided', () => { - return TryOneCommand.run({}, ['foo']).catch((error) => { - expect(error).to.match(/requires a scenario specified in the config/); + expect(getConfigOptions).to.deep.equal({ + configPath: 'foo/bar/widget.js', + cwd: 'foo', }); }); @@ -109,22 +113,17 @@ describe('commands/try-one', () => { }); async function testCommandSetsTheseAsCommandArgs(command, expectedArgs) { - let additionalArgs = command.split(' '); - function MockTask(opts) { - expect(opts.commandArgs).to.eql(expectedArgs); - } - MockTask.prototype.run = async function () {}; - TryOneCommand._TryEachTask = MockTask; - TryOneCommand._commandLineArguments = function () { - return [].concat( - ['/usr/local/Cellar/node/5.3.0/bin/node', '/usr/local/bin/ember'], - additionalArgs, - ); - }; - - TryOneCommand._getConfig = async function () { - return Promise.resolve({ scenarios: [{ name: 'default' }] }); - }; - - return await TryOneCommand.run({}, ['default']); + await tryOne({ + scenarioName: 'default', + + _args: ['/usr/local/Cellar/node/5.3.0/bin/node', '/usr/local/bin/ember', ...command.split(' ')], + _getConfig: () => ({ scenarios: [{ name: 'default' }] }), + _TryEachTask: class { + constructor(options) { + expect(options.commandArgs).to.deep.equal(expectedArgs); + } + + run() {} + }, + }); }