Skip to content
Myr

Add test for #73

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sindre Sorhus · committed by Sindre Sorhus · parent 0f8f7a3 · Browse files · 2 files+16 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−0 removed

  • other:+16 added−0 removed

2 files+16 added−0 removed

added:fixtures/local-dir/package.json+5 added
modified:test.js+11 added
127 unmodified lines
128 await t.throws(m('cat-names', {preferLocal: false}), /spawn .* ENOENT/);129 process.env.PATH = _path;130});131132test('localDir option', async t => {133 const cwd = 'fixtures/local-dir';134 const bin = path.resolve(cwd, 'node_modules/.bin/self-path');135136 await m('npm', ['install', '--no-package-lock'], {cwd});137138 const {stdout} = await m(bin, {localDir: cwd});139140 t.is(path.relative(cwd, stdout), 'node_modules/self-path');141});142143test('input option can be a String', async t => {144 const {stdout} = await m('stdin', {input: 'foobar'});145 t.is(stdout, 'foobar');146});
304 unmodified lines