@@ -41,7 +41,13 @@ test(`single mapped class works on /no-map`, async t => {
4141 t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
4242 const consumer = await getConsumer ( msg . css ) ;
4343 const pos = consumer . originalPositionFor ( { line : 1 , column : 0 } ) ;
44- t . equal ( pos . line , 1 , "mapped line number matches expected" ) ;
44+
45+ const lineNumber =
46+ fixtures . clientNoMapRaw
47+ . split ( "\n" )
48+ . indexOf ( `const err1 = new Error("Line 5");` ) + 1 ;
49+
50+ t . equal ( pos . line , lineNumber , "mapped line number matches expected" ) ;
4551 t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
4652 const { hostname, pathname, protocol} = new URL ( pos . source ) ;
4753 t . equal ( hostname , "localhost" ) ;
@@ -89,7 +95,7 @@ test(`replaying requests after invalidation`, async t => {
8995 t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
9096 const consumer = await getConsumer ( msg . css ) ;
9197 const pos = consumer . originalPositionFor ( { line : 1 , column : 0 } ) ;
92- t . equal ( pos . line , 5 , "mapped line number matches expected" ) ;
98+ t . equal ( pos . line , 7 , "mapped line number matches expected" ) ;
9399 t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
94100 t . equal (
95101 pos . source ,
@@ -159,7 +165,13 @@ test(`fallback if sourcemap request is 404`, async t => {
159165 t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
160166 const consumer = await getConsumer ( msg . css ) ;
161167 const pos = consumer . originalPositionFor ( { line : 1 , column : 0 } ) ;
162- t . equal ( pos . line , 1 , "mapped line number matches expected" ) ;
168+
169+ const lineNumber =
170+ fixtures . clientExternalMapRaw
171+ . split ( "\n" )
172+ . indexOf ( `const err1 = new Error("Line 5");` ) + 1 ;
173+
174+ t . equal ( pos . line , lineNumber , "mapped line number matches expected" ) ;
163175 t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
164176 const { hostname, pathname, protocol} = new URL ( pos . source ) ;
165177 t . equal ( hostname , "localhost" ) ;
@@ -218,7 +230,7 @@ function testSingleMap(route) {
218230 t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
219231 const consumer = await getConsumer ( msg . css ) ;
220232 const pos = consumer . originalPositionFor ( { line : 1 , column : 0 } ) ;
221- t . equal ( pos . line , 5 , "mapped line number matches expected" ) ;
233+ t . equal ( pos . line , 7 , "mapped line number matches expected" ) ;
222234 t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
223235 t . equal (
224236 pos . source ,
0 commit comments