From 60d6149300aa91bbf30d310d1ce8ef7ee71f40ee Mon Sep 17 00:00:00 2001 From: Michael Williams Date: Wed, 3 May 2017 11:27:48 +1200 Subject: [PATCH] add options argument to cli.run use case: when using `ava` as part of a framework cli, i want to be able to pass in some configuration to the `ava` cli, so `ava` runs as the framework expects. --- lib/cli.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index f6213f107..76d92db66 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -20,8 +20,13 @@ const babelConfigHelper = require('./babel-config'); // Bluebird specific Promise.longStackTraces(); -exports.run = () => { - const conf = pkgConf.sync('ava'); +exports.run = (options) => { + options = options || {}; + + const conf = pkgConf.sync('ava', { + defaults: options.defaults, + cwd: options.cwd + }); const filepath = pkgConf.filepath(conf); const projectDir = filepath === null ? process.cwd() : path.dirname(filepath);