Skip to content

Commit

Permalink
Remove unnecessary console output when running test cases (#5384)
Browse files Browse the repository at this point in the history
* Don't show yarn output on console during tests

* Fixed typo in test case names

* Disable console output for some more test cases
  • Loading branch information
sth authored and arcanis committed Feb 23, 2018
1 parent eab88b8 commit 559b5f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
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

0 comments on commit 559b5f2

Please sign in to comment.