Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81155 views
1
/**
2
* Copyright 2013-2014, 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
var React = require('React');
15
var ReactTestUtils = require('ReactTestUtils');
16
var ReactErrorUtils = require('ReactErrorUtils');
17
18
describe('ReactCompositeComponent-error', function() {
19
20
it('should be passed the component and method name', function() {
21
spyOn(ReactErrorUtils, 'guard').andCallThrough();
22
var Component = React.createClass({
23
someHandler: function() {},
24
render: function() {
25
return <div />;
26
}
27
});
28
29
var instance = <Component />;
30
instance = ReactTestUtils.renderIntoDocument(instance);
31
expect(ReactErrorUtils.guard.mostRecentCall.args[1])
32
.toEqual('Component.someHandler');
33
});
34
35
});
36
37