@@ -105,23 +105,23 @@ describe("resolveConfigIssueLineInRaw", () => {
105105 } ) ;
106106
107107 it ( "handles hex numbers as values" , ( ) => {
108- const raw = [ "{" , ' "a": 0x1A' , "}" ] . join ( "\n" ) ;
109- expect ( resolveConfigIssueLineInRaw ( raw , [ "a " ] ) ) . toBe ( 2 ) ;
108+ const raw = [ "{" , ' "a": 0x1A,' , ' "b": 1 ', "}" ] . join ( "\n" ) ;
109+ expect ( resolveConfigIssueLineInRaw ( raw , [ "b " ] ) ) . toBe ( 3 ) ;
110110 } ) ;
111111
112112 it ( "handles leading decimal numbers" , ( ) => {
113- const raw = [ "{" , ' "a": .5' , "}" ] . join ( "\n" ) ;
114- expect ( resolveConfigIssueLineInRaw ( raw , [ "a " ] ) ) . toBe ( 2 ) ;
113+ const raw = [ "{" , ' "a": .5,' , ' "b": 1 ', "}" ] . join ( "\n" ) ;
114+ expect ( resolveConfigIssueLineInRaw ( raw , [ "b " ] ) ) . toBe ( 3 ) ;
115115 } ) ;
116116
117117 it ( "handles Infinity value" , ( ) => {
118- const raw = [ "{" , ' "a": Infinity' , "}" ] . join ( "\n" ) ;
119- expect ( resolveConfigIssueLineInRaw ( raw , [ "a " ] ) ) . toBe ( 2 ) ;
118+ const raw = [ "{" , ' "a": Infinity,' , ' "b": 1 ', "}" ] . join ( "\n" ) ;
119+ expect ( resolveConfigIssueLineInRaw ( raw , [ "b " ] ) ) . toBe ( 3 ) ;
120120 } ) ;
121121
122122 it ( "handles NaN value" , ( ) => {
123- const raw = [ "{" , ' "a": NaN' , "}" ] . join ( "\n" ) ;
124- expect ( resolveConfigIssueLineInRaw ( raw , [ "a " ] ) ) . toBe ( 2 ) ;
123+ const raw = [ "{" , ' "a": NaN,' , ' "b": 1 ', "}" ] . join ( "\n" ) ;
124+ expect ( resolveConfigIssueLineInRaw ( raw , [ "b " ] ) ) . toBe ( 3 ) ;
125125 } ) ;
126126
127127 it ( "handles null and boolean values" , ( ) => {
@@ -147,13 +147,13 @@ describe("resolveConfigIssueLineInRaw", () => {
147147 } ) ;
148148
149149 it ( "handles unicode escape sequences in strings" , ( ) => {
150- const raw = [ "{" , ' "a": "hello \\u0041"' , "}" ] . join ( "\n" ) ;
151- expect ( resolveConfigIssueLineInRaw ( raw , [ "a " ] ) ) . toBe ( 2 ) ;
150+ const raw = [ "{" , ' "a": "hello \\u0041",' , ' "b": 1 ', "}" ] . join ( "\n" ) ;
151+ expect ( resolveConfigIssueLineInRaw ( raw , [ "b " ] ) ) . toBe ( 3 ) ;
152152 } ) ;
153153
154154 it ( "handles multi-line string continuation" , ( ) => {
155- const raw = [ "{" , ' "a": "hello \\' , 'world"' , "}" ] . join ( "\n" ) ;
156- expect ( resolveConfigIssueLineInRaw ( raw , [ "a " ] ) ) . toBe ( 2 ) ;
155+ const raw = [ "{" , ' "a": "hello \\' , 'world",' , ' "b": 1 ', "}" ] . join ( "\n" ) ;
156+ expect ( resolveConfigIssueLineInRaw ( raw , [ "b " ] ) ) . toBe ( 4 ) ;
157157 } ) ;
158158
159159 it ( "handles unicode keys" , ( ) => {
@@ -162,13 +162,8 @@ describe("resolveConfigIssueLineInRaw", () => {
162162 } ) ;
163163
164164 it ( "handles escaped quotes in strings" , ( ) => {
165- const raw = [ "{" , ' "a": "hello \\"world\\""' , "}" ] . join ( "\n" ) ;
166- expect ( resolveConfigIssueLineInRaw ( raw , [ "a" ] ) ) . toBe ( 2 ) ;
167- } ) ;
168-
169- it ( "handles numeric separators in values" , ( ) => {
170- const raw = [ "{" , ' "a": 1_000' , "}" ] . join ( "\n" ) ;
171- expect ( resolveConfigIssueLineInRaw ( raw , [ "a" ] ) ) . toBe ( 2 ) ;
165+ const raw = [ "{" , ' "a": "hello \\"world\\"",' , ' "b": 1' , "}" ] . join ( "\n" ) ;
166+ expect ( resolveConfigIssueLineInRaw ( raw , [ "b" ] ) ) . toBe ( 3 ) ;
172167 } ) ;
173168
174169 it ( "handles block comments before keys" , ( ) => {
0 commit comments