Skip to content

Commit

Permalink
chore: add test for skipTrivia
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed May 17, 2020
1 parent 0d25217 commit a52a1d0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tests/cases/conformance/jsx/16.tsx(1,2): error TS17008: JSX element 'a' has no c
tests/cases/conformance/jsx/16.tsx(1,10): error TS1005: '</' expected.
tests/cases/conformance/jsx/17.tsx(1,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/17.tsx(1,10): error TS1005: '</' expected.
tests/cases/conformance/jsx/18.tsx(1,9): error TS2657: JSX expressions must have one parent element.
tests/cases/conformance/jsx/18.tsx(1,30): error TS2657: JSX expressions must have one parent element.
tests/cases/conformance/jsx/19.tsx(1,9): error TS2657: JSX expressions must have one parent element.
tests/cases/conformance/jsx/2.tsx(1,3): error TS1003: Identifier expected.
tests/cases/conformance/jsx/20.tsx(1,10): error TS1005: '}' expected.
Expand Down Expand Up @@ -227,8 +227,8 @@ tests/cases/conformance/jsx/9.tsx(1,16): error TS1109: Expression expected.

!!! error TS1005: '</' expected.
==== tests/cases/conformance/jsx/18.tsx (1 errors) ====
var x = <div>one</div><div>two</div>;;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var x = /* Leading trivia */ <div>one</div><div>two</div>;;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2657: JSX expressions must have one parent element.
==== tests/cases/conformance/jsx/19.tsx (1 errors) ====
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/jsxInvalidEsprimaTestSuite.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ declare var React: any;
//// [17.tsx]
<a b={}>;
//// [18.tsx]
var x = <div>one</div><div>two</div>;;
var x = /* Leading trivia */ <div>one</div><div>two</div>;;
//// [19.tsx]
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
//// [20.tsx]
Expand Down Expand Up @@ -117,7 +117,7 @@ a['foo'] > ;
//// [17.jsx]
<a b=>;</>;
//// [18.jsx]
var x = <div>one</div>, <div>two</div>;
var x = /* Leading trivia */ <div>one</div>, <div>two</div>;
;
//// [19.jsx]
var x = <div>one</div> /* intervening comment */, /* intervening comment */ <div>two</div>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ No type information for this code.=== tests/cases/conformance/jsx/17.tsx ===
>b : Symbol(b, Decl(17.tsx, 0, 2))

=== tests/cases/conformance/jsx/18.tsx ===
var x = <div>one</div><div>two</div>;;
var x = /* Leading trivia */ <div>one</div><div>two</div>;;
>x : Symbol(x, Decl(18.tsx, 0, 3), Decl(19.tsx, 0, 3))

=== tests/cases/conformance/jsx/19.tsx ===
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/jsxInvalidEsprimaTestSuite.types
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ declare var React: any;
> : any

=== tests/cases/conformance/jsx/18.tsx ===
var x = <div>one</div><div>two</div>;;
var x = /* Leading trivia */ <div>one</div><div>two</div>;;
>x : any
><div>one</div><div>two</div> : any
><div>one</div> : any
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ declare var React: any;
// @filename: 17.tsx
<a b={}>;
// @filename: 18.tsx
var x = <div>one</div><div>two</div>;;
var x = /* Leading trivia */ <div>one</div><div>two</div>;;
// @filename: 19.tsx
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
// @filename: 20.tsx
Expand Down

0 comments on commit a52a1d0

Please sign in to comment.