diff --git a/index.js b/index.js index 72f5717..3e43373 100644 --- a/index.js +++ b/index.js @@ -88,7 +88,7 @@ const open = async (target, options) => { })); } - let {name: app, appArguments = []} = options.app || {}; + let {name: app, arguments: appArguments = []} = options.app || {}; if (Array.isArray(app)) { return pTryEach(app, appName => open(target, { diff --git a/test.js b/test.js index 271043f..447e5df 100644 --- a/test.js +++ b/test.js @@ -27,7 +27,10 @@ test('open URL in specified app', async t => { }); test('open URL in specified app with arguments', async t => { - await t.notThrowsAsync(open('https://sindresorhus.com', {app: {name: open.apps.chrome, arguments: ['--incognito']}})); + await t.notThrowsAsync(async () => { + const proc = await open('https://sindresorhus.com', {app: {name: open.apps.chrome, arguments: ['--incognito']}}); + t.deepEqual(proc.spawnargs, ['open', '-a', open.apps.chrome, 'https://sindresorhus.com', '--args', '--incognito']); + }); }); test('return the child process when called', async t => {