@@ -6,13 +6,33 @@ describe("classconstant", () => {
66 parser . parseEval ( 'class Foo { const CONSTANT = "Hello world!"; }' ) ,
77 ) . toMatchSnapshot ( ) ;
88 } ) ;
9+ it ( "simple using 8.3" , ( ) => {
10+ expect (
11+ parser . parseEval ( `class Foo { const CONSTANT = "Hello world!"; }` , {
12+ parser : { version : 803 } ,
13+ } ) ,
14+ ) . toMatchSnapshot ( ) ;
15+ } ) ;
16+
917 it ( "multiple" , ( ) => {
1018 expect (
1119 parser . parseEval (
1220 'class Foo { const CONSTANT = "Hello world!", OTHER_CONSTANT = "Other hello world!"; }' ,
1321 ) ,
1422 ) . toMatchSnapshot ( ) ;
1523 } ) ;
24+
25+ it ( "multiple 8.3" , ( ) => {
26+ expect (
27+ parser . parseEval (
28+ 'class Foo { const NAME_1 = "Hello world!", NAME_2 = "Other hello world!"; }' ,
29+ {
30+ parser : { version : 803 } ,
31+ } ,
32+ ) ,
33+ ) . toMatchSnapshot ( ) ;
34+ } ) ;
35+
1636 it ( "public" , ( ) => {
1737 expect (
1838 parser . parseEval ( 'class Foo { public const CONSTANT = "Hello world!"; }' ) ,
@@ -43,15 +63,15 @@ describe("classconstant", () => {
4363 expect (
4464 parser . parseEval (
4565 'class Foo { public const string CONSTANT = "Hello world!"; }' ,
46- { parser : { version : 830 } } ,
66+ { parser : { version : 803 } } ,
4767 ) ,
4868 ) . toMatchSnapshot ( ) ;
4969 } ) ;
5070 it ( "type hinted (unsupported)" , ( ) => {
5171 expect ( ( ) =>
5272 parser . parseEval (
5373 'class Foo { public const string CONSTANT = "Hello world!"; }' ,
54- { parser : { version : 820 } } ,
74+ { parser : { version : 802 } } ,
5575 ) ,
5676 ) . toThrowErrorMatchingSnapshot ( ) ;
5777 } ) ;
0 commit comments