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

test(integration): Fix react-scripts test due to unexpected warning #5076

Merged
merged 1 commit into from
Dec 11, 2017
Merged
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
8 changes: 4 additions & 4 deletions __tests__/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000;

const path = require('path');

function addTest(pattern, {strict} = {strict: false}, yarnArgs: Array<string> = []) {
function addTest(pattern, {strictPeers} = {strictPeers: false}, yarnArgs: Array<string> = []) {
test.concurrent(`yarn add ${pattern}`, async () => {
const cwd = await makeTemp();
const cacheFolder = path.join(cwd, 'cache');
Expand All @@ -31,8 +31,8 @@ function addTest(pattern, {strict} = {strict: false}, yarnArgs: Array<string> =
);

const result = await execa(command, ['add', pattern].concat(args), options);
if (strict) {
expect(result.stderr).not.toMatch(/^warning /gm);
if (strictPeers) {
expect(result.stderr).not.toMatch(/^warning .+ peer dependency/gm);
}

await fs.unlink(cwd);
Expand Down Expand Up @@ -60,7 +60,7 @@ addTest('https://[email protected]/stevemao/left-pad.git'); // git url, with userna
addTest('https://github.com/yarnpkg/yarn/releases/download/v0.18.1/yarn-v0.18.1.tar.gz'); // tarball
addTest('https://github.com/bestander/chrome-app-livereload.git'); // no package.json
addTest('bestander/chrome-app-livereload'); // no package.json, github, tarball
addTest('[email protected]', {strict: true}, ['--no-node-version-check', '--ignore-engines']); // many peer dependencies, there shouldn't be any peerDep warnings
addTest('[email protected]', {strictPeers: true}, ['--no-node-version-check', '--ignore-engines']); // many peer dependencies, there shouldn't be any peerDep warnings

const MIN_PORT_NUM = 56000;
const MAX_PORT_NUM = 65535;
Expand Down