Skip to content

Commit

Permalink
Merge pull request #929 from trygveaa/dependency-error-message
Browse files Browse the repository at this point in the history
Make sure dependency error reporting always works
  • Loading branch information
nfcampos authored May 6, 2017
2 parents 84e10fa + 75e7cd8 commit ba17a90
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/react-compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,11 @@ if (REACT013) {
// eslint-disable-next-line import/no-extraneous-dependencies
ReactDOM = require('react-dom');
} catch (e) {
// eslint-disable-next-line no-console
console.error(
throw new Error(
'react-dom is an implicit dependency in order to support react@0.13-14. ' +
'Please add the appropriate version to your devDependencies. ' +
'See https://github.com/airbnb/enzyme#installation',
);
throw e;
}

// eslint-disable-next-line import/no-extraneous-dependencies
Expand Down Expand Up @@ -116,19 +114,18 @@ if (REACT013) {
}
} catch (e) {
if (REACT155) {
console.error( // eslint-disable-line no-console
throw new Error(
'react-dom@15.5+ and react-test-renderer are implicit dependencies when using ' +
'react@15.5+ with enzyme. Please add the appropriate version to your ' +
'devDependencies. See https://github.com/airbnb/enzyme#installation',
);
} else {
console.error( // eslint-disable-line no-console
throw new Error(
'react-addons-test-utils is an implicit dependency in order to support react@0.13-14. ' +
'Please add the appropriate version to your devDependencies. ' +
'See https://github.com/airbnb/enzyme#installation',
);
}
throw e;
}

// Shallow rendering changed from 0.13 => 0.14 in such a way that
Expand Down

0 comments on commit ba17a90

Please sign in to comment.