File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright 2013-present, Facebook, Inc.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree. An additional grant
7+ * of patent rights can be found in the PATENTS file in the same directory.
8+ *
9+ * @emails react-core
10+ */
11+
12+ 'use strict' ;
13+
14+ describe ( 'React' , ( ) => {
15+
16+ var React ;
17+
18+ beforeEach ( ( ) => {
19+ React = require ( 'React' ) ;
20+ } ) ;
21+
22+ it ( 'should log a deprecation warning once when using React.__spread' , ( ) => {
23+ spyOn ( console , 'error' ) ;
24+ React . __spread ( { } ) ;
25+ React . __spread ( { } ) ;
26+ expect ( console . error . calls . count ( ) ) . toBe ( 1 ) ;
27+ expect ( console . error . calls . argsFor ( 0 ) [ 0 ] ) . toContain (
28+ 'React.__spread is deprecated and should not be used'
29+ ) ;
30+ } ) ;
31+
32+ it ( 'should log a deprecation warning once when using React.createMixin' , ( ) => {
33+ spyOn ( console , 'error' ) ;
34+ React . createMixin ( ) ;
35+ React . createMixin ( ) ;
36+ expect ( console . error . calls . count ( ) ) . toBe ( 1 ) ;
37+ expect ( console . error . calls . argsFor ( 0 ) [ 0 ] ) . toContain (
38+ 'React.createMixin is deprecated and should not be used'
39+ ) ;
40+ } ) ;
41+
42+ } ) ;
You can’t perform that action at this time.
0 commit comments