Skip to content

Commit

Permalink
some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bdwain committed Apr 26, 2018
1 parent c2deadd commit 7d578ed
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions __tests__/commands/install/focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,28 @@ test.concurrent('focus shallowly installs anything that a sibling needed to shal
expect(JSON.parse(packageFile).version).toEqual('1.1.2');
},
);
});

test.concurrent('focus does not shallowly a sibling\'s dev dependencies', (): Promise<
void,
> => {
return runInstall(
{focus: true},
{source: 'published-monorepo', cwd: '/packages/example-yarn-workspace-4'},
async (config, reporter) => {
expect(await fs.exists(path.join(config.cwd, 'node_modules', 'example-yarn-workspace-3', 'node_modules', 'left-pad'))).toBeFalsy();
},
);
});

test.concurrent('focus runs shallow dependencies\' postinstall scripts', (): Promise<
void,
> => {
return runInstall(
{focus: true},
{source: 'published-monorepo', cwd: '/packages/example-yarn-workspace-4'},
async (config, reporter) => {
expect(await fs.exists(path.join(config.cwd, 'node_modules', 'example-yarn-workspace-3', 'temp.out'))).toBeTruthy();
},
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.1",
"dependencies": {
"example-yarn-workspace-2": "^1.0.0",
"left-pad": "1.3.0"
"left-pad": "1.1.3"
},
"main": "index.js"
}

0 comments on commit 7d578ed

Please sign in to comment.