Skip to content

Commit

Permalink
Replaced another console.error() call with fbjs warning()
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Apr 6, 2017
1 parent 4f5aa2e commit d11c546
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion addons/react-addons-test-utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@

'use strict';

var warning = require('fbjs/lib/warning');

// This package has been deprecated in NPM as of version 15.5.0
// But NPM deprecation warnings are easy to overlook
// So a more explicit runtime warning seemed appropriate
console.error(
warning(
false,
'ReactTestUtils has been moved to react-dom/test-utils. ' +
'Update references to remove this warning.'
);
Expand Down
2 changes: 1 addition & 1 deletion addons/react-addons-test-utils/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('ReactTestUtils', function() {

it('should warn on include', function() {
expect(console.error).toHaveBeenCalledWith(
'ReactTestUtils has been moved to react-dom/test-utils. ' +
'Warning: ReactTestUtils has been moved to react-dom/test-utils. ' +
'Update references to remove this warning.'
);
});
Expand Down

0 comments on commit d11c546

Please sign in to comment.