From f07e89e79029a5f0db7a77ca8c6a8e8b542e4f52 Mon Sep 17 00:00:00 2001 From: Stephan Hohe Date: Wed, 21 Feb 2018 00:27:06 +0000 Subject: [PATCH 1/3] Don't show yarn output on console during tests --- __tests__/commands/add.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/__tests__/commands/add.js b/__tests__/commands/add.js index 3cb7e72bf1..46b4c7702d 100644 --- a/__tests__/commands/add.js +++ b/__tests__/commands/add.js @@ -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 => { - const reporter = new ConsoleReporter({}); - + await runInstall({binLinks: true}, 'workspaces-install-bin', async (config, reporter): Promise => { 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); @@ -1143,9 +1141,7 @@ 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 => { - const reporter = new ConsoleReporter({}); - + await runInstall({}, 'workspaces-install-nohoist-across-versions', async (config, reporter): Promise => { // 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); @@ -1172,9 +1168,7 @@ describe('nohoist', () => { }); }); test.concurrent('can add nohoist pacakge from root', async () => { - await runInstall({}, 'workspaces-install-nohoist-across-versions', async (config): Promise => { - const reporter = new ConsoleReporter({}); - + await runInstall({}, 'workspaces-install-nohoist-across-versions', async (config, reporter): Promise => { // 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); From f4d6ce5729a9575fd5dfd3636afb52d4607e024a Mon Sep 17 00:00:00 2001 From: Stephan Hohe Date: Wed, 21 Feb 2018 00:50:22 +0000 Subject: [PATCH 2/3] Fixed typo in test case names --- __tests__/commands/add.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/commands/add.js b/__tests__/commands/add.js index 46b4c7702d..d27f9544eb 100644 --- a/__tests__/commands/add.js +++ b/__tests__/commands/add.js @@ -1140,7 +1140,7 @@ test.concurrent('installs "latest" instead of maxSatisfying if no requested patt }); describe('nohoist', () => { - test.concurrent('can add nohoist pacakge from workspace', async () => { + test.concurrent('can add nohoist package from workspace', async () => { await runInstall({}, 'workspaces-install-nohoist-across-versions', async (config, reporter): Promise => { // 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); @@ -1167,7 +1167,7 @@ describe('nohoist', () => { expect(await fs.exists(`${config.cwd}/node_modules/c`)).toEqual(false); }); }); - test.concurrent('can add nohoist pacakge from root', async () => { + test.concurrent('can add nohoist package from root', async () => { await runInstall({}, 'workspaces-install-nohoist-across-versions', async (config, reporter): Promise => { // 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); From 56ab28a983ea769c24c5ddee7bdef6fe1f3378f1 Mon Sep 17 00:00:00 2001 From: Stephan Hohe Date: Wed, 21 Feb 2018 00:55:42 +0000 Subject: [PATCH 3/3] Disable console output for some more test cases --- __tests__/commands/remove.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/__tests__/commands/remove.js b/__tests__/commands/remove.js index 40ef91ee2d..adf23538b8 100644 --- a/__tests__/commands/remove.js +++ b/__tests__/commands/remove.js @@ -147,9 +147,7 @@ test.concurrent('removes package installed without a manifest', (): Promise { - await runInstall({}, 'workspaces-install-basic', async (config): Promise => { - const reporter = new ConsoleReporter({}); - + await runInstall({}, 'workspaces-install-basic', async (config, reporter): Promise => { expect(await fs.exists(`${config.cwd}/node_modules/isarray`)).toEqual(true); expect(await fs.exists(`${config.cwd}/workspace-child/node_modules/isarray`)).toEqual(false); @@ -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 => { - const reporter = new ConsoleReporter({}); - + await runInstall({binLinks: true}, 'workspaces-install-bin', async (config, reporter): Promise => { 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);