@@ -41,7 +41,13 @@ test(`single mapped class works on /no-map`, async t => {
41
41
t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
42
42
const consumer = await getConsumer ( msg . css ) ;
43
43
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" ) ;
45
51
t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
46
52
const { hostname, pathname, protocol} = new URL ( pos . source ) ;
47
53
t . equal ( hostname , "localhost" ) ;
@@ -89,7 +95,7 @@ test(`replaying requests after invalidation`, async t => {
89
95
t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
90
96
const consumer = await getConsumer ( msg . css ) ;
91
97
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" ) ;
93
99
t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
94
100
t . equal (
95
101
pos . source ,
@@ -159,7 +165,13 @@ test(`fallback if sourcemap request is 404`, async t => {
159
165
t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
160
166
const consumer = await getConsumer ( msg . css ) ;
161
167
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" ) ;
163
175
t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
164
176
const { hostname, pathname, protocol} = new URL ( pos . source ) ;
165
177
t . equal ( hostname , "localhost" ) ;
@@ -218,7 +230,7 @@ function testSingleMap(route) {
218
230
t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
219
231
const consumer = await getConsumer ( msg . css ) ;
220
232
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" ) ;
222
234
t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
223
235
t . equal (
224
236
pos . source ,
0 commit comments