* feat(react-jsx-source): add column property This will be useful to tools that consume the injected `__source` prop, allowing precise source locations to be displayed. * Rename column -> columnNumber, make 1-based
21 lines
423 B
JavaScript
21 lines
423 B
JavaScript
const actual = transform(
|
|
'<Foo bar="baz" />',
|
|
Object.assign({}, opts, { filename: '/fake/path/mock.js' })
|
|
).code;
|
|
|
|
const expected = multiline([
|
|
'var _jsxFileName = "/fake/path/mock.js";',
|
|
'React.createElement(Foo, {',
|
|
' bar: "baz",',
|
|
' __source: {',
|
|
' fileName: _jsxFileName,',
|
|
' lineNumber: 1,',
|
|
' columnNumber: 1',
|
|
' },',
|
|
' __self: this',
|
|
'});',
|
|
]);
|
|
|
|
|
|
expect(actual).toBe(expected);
|