Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary console output when running test cases #5384

Merged
merged 3 commits into from
Feb 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions __tests__/commands/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -1075,9 +1075,7 @@ test.concurrent('installing with --pure-lockfile and then adding should keep bui
});

test.concurrent('preserves unaffected bin links after adding to workspace package', async () => {
await runInstall({binLinks: true}, 'workspaces-install-bin', async (config): Promise<void> => {
const reporter = new ConsoleReporter({});

await runInstall({binLinks: true}, 'workspaces-install-bin', async (config, reporter): Promise<void> => {
expect(await fs.exists(`${config.cwd}/node_modules/.bin/rimraf`)).toEqual(true);
expect(await fs.exists(`${config.cwd}/node_modules/.bin/touch`)).toEqual(true);
expect(await fs.exists(`${config.cwd}/node_modules/.bin/workspace-1`)).toEqual(true);
Expand Down Expand Up @@ -1142,10 +1140,8 @@ test.concurrent('installs "latest" instead of maxSatisfying if no requested patt
});

describe('nohoist', () => {
test.concurrent('can add nohoist pacakge from workspace', async () => {
await runInstall({}, 'workspaces-install-nohoist-across-versions', async (config): Promise<void> => {
const reporter = new ConsoleReporter({});

test.concurrent('can add nohoist package from workspace', async () => {
await runInstall({}, 'workspaces-install-nohoist-across-versions', async (config, reporter): Promise<void> => {
// workspace-2 has b and c since the root has nohoist = ['a', 'b', 'c']
expect(await fs.exists(`${config.cwd}/packages/workspace-2/node_modules/b`)).toEqual(true);
expect(await fs.exists(`${config.cwd}/packages/workspace-2/node_modules/c`)).toEqual(true);
Expand All @@ -1171,10 +1167,8 @@ describe('nohoist', () => {
expect(await fs.exists(`${config.cwd}/node_modules/c`)).toEqual(false);
});
});
test.concurrent('can add nohoist pacakge from root', async () => {
await runInstall({}, 'workspaces-install-nohoist-across-versions', async (config): Promise<void> => {
const reporter = new ConsoleReporter({});

test.concurrent('can add nohoist package from root', async () => {
await runInstall({}, 'workspaces-install-nohoist-across-versions', async (config, reporter): Promise<void> => {
// prove package a does not exist in workspace-2 nor in root
expect(await fs.exists(`${config.cwd}/packages/workspace-2/node_modules/a`)).toEqual(false);
expect(await fs.exists(`${config.cwd}/node_modules/a`)).toEqual(false);
Expand Down
8 changes: 2 additions & 6 deletions __tests__/commands/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ test.concurrent('removes package installed without a manifest', (): Promise<void
});

test.concurrent('removes from workspace packages', async () => {
await runInstall({}, 'workspaces-install-basic', async (config): Promise<void> => {
const reporter = new ConsoleReporter({});

await runInstall({}, 'workspaces-install-basic', async (config, reporter): Promise<void> => {
expect(await fs.exists(`${config.cwd}/node_modules/isarray`)).toEqual(true);
expect(await fs.exists(`${config.cwd}/workspace-child/node_modules/isarray`)).toEqual(false);

Expand All @@ -173,9 +171,7 @@ test.concurrent('removes from workspace packages', async () => {
});

test.concurrent('preserves unaffected bin links after removing workspace packages', async () => {
await runInstall({binLinks: true}, 'workspaces-install-bin', async (config): Promise<void> => {
const reporter = new ConsoleReporter({});

await runInstall({binLinks: true}, 'workspaces-install-bin', async (config, reporter): Promise<void> => {
expect(await fs.exists(`${config.cwd}/node_modules/.bin/rimraf`)).toEqual(true);
expect(await fs.exists(`${config.cwd}/node_modules/.bin/touch`)).toEqual(true);
expect(await fs.exists(`${config.cwd}/node_modules/.bin/workspace-1`)).toEqual(true);
Expand Down