From d11c5467bd55791b5f652f3631b28681674d5239 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 6 Apr 2017 11:39:31 -0700 Subject: [PATCH] Replaced another console.error() call with fbjs warning() --- addons/react-addons-test-utils/index.js | 5 ++++- addons/react-addons-test-utils/test.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/react-addons-test-utils/index.js b/addons/react-addons-test-utils/index.js index 11ff903d2a4a9..8d33b1832987a 100644 --- a/addons/react-addons-test-utils/index.js +++ b/addons/react-addons-test-utils/index.js @@ -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.' ); diff --git a/addons/react-addons-test-utils/test.js b/addons/react-addons-test-utils/test.js index 06f808dc21d57..edcd2b7cf6276 100644 --- a/addons/react-addons-test-utils/test.js +++ b/addons/react-addons-test-utils/test.js @@ -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.' ); });