diff --git a/src/renderers/__tests__/ReactStatelessComponent-test.js b/src/renderers/__tests__/ReactStatelessComponent-test.js
index c8d67c7bbfc2c..577a6c1ee13d6 100644
--- a/src/renderers/__tests__/ReactStatelessComponent-test.js
+++ b/src/renderers/__tests__/ReactStatelessComponent-test.js
@@ -295,6 +295,43 @@ describe('ReactStatelessComponent', () => {
console.error.calls.reset();
});
+ // This guards against a regression caused by clearing the current debug fiber.
+ // https://github.com/facebook/react/issues/10831
+ it('should warn when giving a function ref with context', () => {
+ spyOn(console, 'error');
+
+ function Child() {
+ return null;
+ }
+ Child.contextTypes = {
+ foo: PropTypes.string,
+ };
+
+ class Parent extends React.Component {
+ static childContextTypes = {
+ foo: PropTypes.string,
+ };
+ getChildContext() {
+ return {
+ foo: 'bar',
+ };
+ }
+ render() {
+ return