Skip to content
Permalink
Browse files
Add test for #73
  • Loading branch information
sindresorhus committed Jun 9, 2017
1 parent 0f8f7a3 commit c7481f4c6b3c51c2cdab13a6b54521ecab679141
Showing 2 changed files with 16 additions and 0 deletions.
@@ -0,0 +1,5 @@
{
"dependencies": {
"self-path": "^1.0.0"
}
}
11 test.js
@@ -129,6 +129,17 @@ test.serial('preferLocal option', async t => {
process.env.PATH = _path;
});

test('localDir option', async t => {
const cwd = 'fixtures/local-dir';
const bin = path.resolve(cwd, 'node_modules/.bin/self-path');

await m('npm', ['install', '--no-package-lock'], {cwd});

const {stdout} = await m(bin, {localDir: cwd});

t.is(path.relative(cwd, stdout), 'node_modules/self-path');
});

test('input option can be a String', async t => {
const {stdout} = await m('stdin', {input: 'foobar'});
t.is(stdout, 'foobar');

0 comments on commit c7481f4

Please sign in to comment.