Last active
October 21, 2015 08:09
-
-
Save geta6/798ed05b238ade75b6cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* global jest, expect */ | |
| jest.dontMock('../App'); | |
| jest.dontMock('../../decorators/decorator'); | |
| const React = require('react'); | |
| const ReactDOM = require('react-dom'); | |
| const ReactTestUtils = require('react-addons-test-utils'); | |
| const App = require('../App'); | |
| describe('App', () => { | |
| it('should set state', () => { | |
| const component = ReactTestUtils.renderIntoDocument(<App />); | |
| expect(ReactDOM.findDOMNode(component).innerHTML).toEqual('ほげほげふがふが'); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {PropTypes, Component} from 'react'; | |
| import decorator from '../../decorators/decorator'; | |
| @decorator() | |
| class App extends Component { | |
| render() { | |
| return <div>ほげほげふがふが</div>; | |
| } | |
| } | |
| export default App; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-disable */ | |
| 'use strict'; | |
| var babel = require('babel-core'); | |
| module.exports = { | |
| process: function(src, filename) { | |
| if (!babel.canCompile(filename)) { | |
| return ''; | |
| } | |
| if (filename.indexOf('node_modules') === -1) { | |
| return babel.transform(src, { | |
| filename: filename, | |
| retainLines: true, | |
| auxiliaryCommentBefore: 'istanbul ignore next' | |
| }).code; | |
| } | |
| return src; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment