Skip to content

Commit

Permalink
Add test that manifest-less local packages are installable, yarnpkg#4257
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Sep 14, 2017
1 parent 738df57 commit c004dc3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion __tests__/commands/install/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,22 @@ test.concurrent("don't install with file: protocol as default if target is a fil
return expect(runInstall({lockfile: false}, 'install-file-as-default-no-file')).rejects.toBeDefined();
});

test.concurrent("don't install with file: protocol as default if target does not have package.json", (): Promise<
test.concurrent("don't install with implicit file: protocol if target does not have package.json", (): Promise<
void,
> => {
// $FlowFixMe
return expect(runInstall({lockfile: false}, 'install-file-as-default-no-package')).rejects.toBeDefined();
});

test.concurrent("install with explicit file: protocol if target does not have package.json", (): Promise<
void,
> => {
return runInstall({}, 'install-file-no-package', async config => {
expect(await fs.exists(path.join(config.cwd, 'node_modules', 'foo', 'bar.js'))).toEqual(true);
expect(await fs.exists(path.join(config.cwd, 'node_modules', 'bar', 'bar.js'))).toEqual(true);
});
});

test.concurrent("don't install with file: protocol as default if target is valid semver", (): Promise<void> => {
return runInstall({}, 'install-file-as-default-no-semver', async config => {
expect(await fs.readFile(path.join(config.cwd, 'node_modules', 'foo', 'package.json'))).toMatchSnapshot(
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencies": {
"foo": "file:bar",
"bar": "./bar"
}
}

0 comments on commit c004dc3

Please sign in to comment.