Skip to content

Instantly share code, notes, and snippets.

Created April 27, 2015 01:45
Show Gist options
  • Save anonymous/ac700b7968b432057088 to your computer and use it in GitHub Desktop.
Save anonymous/ac700b7968b432057088 to your computer and use it in GitHub Desktop.
react contextTypes jest problem
jest.dontMock('../AppBarButtons');
describe('AppBarButtons', function() {
var React = require('react/addons');
var AppBarButtons = require('../AppBarButtons');
});
/**
* FAIL app\scripts\components\__tests__\AppBarButtons-test.jsx (1.179s)
* AppBarButtons › it encountered a declaration exception
* - TypeError: app\scripts\components\AppBarButtons.jsx: undefined is not a function
* at app\scripts\components\AppBarButtons.jsx:15:27
* at Suite.<anonymous> (app\scripts\components\__tests__\AppBarButtons-test.jsx:7:23)
* at env.describe_ (<anonymous>:40:25)
* at env.describe (<anonymous>:27:19)
* at describe (node_modules\jest-cli\vendor\jasmine\jasmine-1.3.0.js:604:27)
* at app\scripts\components\__tests__\AppBarButtons-test.jsx:5:1
* 1 test failed, 0 tests passed (1 total)
*/
var React = require('react');
var AppBarButtons = React.createClass({
render () {
return(<div/>);
}
});
module.exports = AppBarButtons;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment