Skip to content

Commit ce21316

Browse files
committed
fix: SyntaxError message related tags
1 parent c7ebfe1 commit ce21316

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/babel-plugin-react-jsx/__tests__/TransformJSXToReactCreateElement-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ describe('transform react to jsx', () => {
201201
}
202202
expect(_error).toEqual(
203203
new SyntaxError(
204-
'undefined: Spread children are not supported in React.' +
204+
'unknown: Spread children are not supported in React.' +
205205
'\n' +
206206
codeFrame.codeFrameColumns(
207207
code,
208-
{start: {line: 1, column: 6}},
208+
{start: {line: 1, column: 6}, end: {line: 1, column: 19}},
209209
{highlightCode: true}
210210
)
211211
)
@@ -355,13 +355,13 @@ describe('transform react to jsx', () => {
355355
}
356356
expect(_error).toEqual(
357357
new SyntaxError(
358-
"undefined: Namespace tags are not supported by default. React's " +
358+
"unknown: Namespace tags are not supported by default. React's " +
359359
"JSX doesn't support namespace tags. You can turn on the " +
360360
"'throwIfNamespace' flag to bypass this warning." +
361361
'\n' +
362362
codeFrame.codeFrameColumns(
363363
code,
364-
{start: {line: 1, column: 2}},
364+
{start: {line: 1, column: 2}, end: {line: 1, column: 9}},
365365
{highlightCode: true}
366366
)
367367
)

packages/babel-plugin-react-jsx/__tests__/TransformJSXToReactJSX-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ describe('transform react to jsx', () => {
292292
}
293293
expect(_error).toEqual(
294294
new SyntaxError(
295-
'undefined: Spread children are not supported in React.' +
295+
'unknown: Spread children are not supported in React.' +
296296
'\n' +
297297
codeFrame.codeFrameColumns(
298298
code,
299-
{start: {line: 1, column: 6}},
299+
{start: {line: 1, column: 6}, end: {line: 1, column: 19}},
300300
{highlightCode: true}
301301
)
302302
)
@@ -446,13 +446,13 @@ describe('transform react to jsx', () => {
446446
}
447447
expect(_error).toEqual(
448448
new SyntaxError(
449-
"undefined: Namespace tags are not supported by default. React's " +
449+
"unknown: Namespace tags are not supported by default. React's " +
450450
"JSX doesn't support namespace tags. You can turn on the " +
451451
"'throwIfNamespace' flag to bypass this warning." +
452452
'\n' +
453453
codeFrame.codeFrameColumns(
454454
code,
455-
{start: {line: 1, column: 2}},
455+
{start: {line: 1, column: 2}, end: {line: 1, column: 9}},
456456
{highlightCode: true}
457457
)
458458
)

0 commit comments

Comments
 (0)