-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
46a57f9
commit 30b738e
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`generic-array 1`] = ` | ||
"'use strict'; | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\"Cannot call a class as a function\\"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\\"this hasn't been initialised - super() hasn't been called\\"); } return call && (typeof call === \\"object\\" || typeof call === \\"function\\") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== \\"function\\" && superClass !== null) { throw new TypeError(\\"Super expression must either be null or a function, not \\" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var ReadOnlyArrayTest = function (_React$Component) { | ||
_inherits(ReadOnlyArrayTest, _React$Component); | ||
function ReadOnlyArrayTest() { | ||
_classCallCheck(this, ReadOnlyArrayTest); | ||
return _possibleConstructorReturn(this, (ReadOnlyArrayTest.__proto__ || Object.getPrototypeOf(ReadOnlyArrayTest)).apply(this, arguments)); | ||
} | ||
return ReadOnlyArrayTest; | ||
}(_react2.default.Component); | ||
ReadOnlyArrayTest.propTypes = { | ||
foo: _propTypes2.default.arrayOf(_propTypes2.default.number.isRequired).isRequired | ||
};" | ||
`; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const babel = require('babel-core'); | ||
const content = ` | ||
import React from 'react'; | ||
type Props = { | ||
foo: $ReadOnlyArray<number>, | ||
}; | ||
class ReadOnlyArrayTest extends React.Component<Props> {} | ||
`; | ||
|
||
it('generic-array', () => { | ||
const res = babel.transform(content, { | ||
babelrc: false, | ||
presets: ['es2015', 'stage-1', 'react'], | ||
plugins: ['syntax-flow', require('../')], | ||
}).code; | ||
expect(res).toMatchSnapshot(); | ||
}); |
This file contains 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