@@ -18,7 +18,7 @@ const fixtures = {
1818 "utf-8" ,
1919 ) ,
2020 clientNoMapRaw : fs . readFileSync (
21- require . resolve ( "css-to-js-sourcemap-fixture-app/static /no-map.js" ) ,
21+ require . resolve ( "css-to-js-sourcemap-fixture-app/public/_static /no-map.js" ) ,
2222 "utf-8" ,
2323 ) ,
2424} ;
@@ -39,7 +39,7 @@ test(`single mapped class works on /no-map`, async t => {
3939 t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
4040 const { hostname, pathname, protocol} = new URL ( pos . source ) ;
4141 t . equal ( hostname , "localhost" ) ;
42- t . equal ( pathname , "/no-map.js" ) ;
42+ t . equal ( pathname , "/_static/ no-map.js" ) ;
4343 t . equal ( protocol , "http:" ) ;
4444 const content = consumer . sourceContentFor ( pos . source ) ;
4545 t . equal (
@@ -132,30 +132,36 @@ test(`replaying requests after invalidation`, async t => {
132132
133133function testSingleMap ( route ) {
134134 test ( `single mapped class works on ${ route } ` , async t => {
135- const { page, browser, server} = await setup ( route , async msg => {
136- if ( msg . css ) {
137- const lines = msg . css . split ( "\n" ) ;
138- t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
139- const consumer = await getConsumer ( msg . css ) ;
140- const pos = consumer . originalPositionFor ( { line : 1 , column : 0 } ) ;
141- t . equal ( pos . line , 5 , "mapped line number matches expected" ) ;
142- t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
143- t . equal (
144- pos . source ,
145- "webpack:///client.js?n=0" ,
146- "mapped source matches expected" ,
147- ) ;
148- const content = consumer . sourceContentFor ( "webpack:///client.js?n=0" ) ;
149- t . equal (
150- content ,
151- fixtures . clientSource ,
152- "mapped source content matches expected" ,
153- ) ;
154- await browser . close ( ) ;
155- server . close ( ) ;
156- t . end ( ) ;
157- }
158- } ) ;
135+ const { page, browser, server} = await setup (
136+ route ,
137+ async msg => {
138+ if ( msg . css ) {
139+ const lines = msg . css . split ( "\n" ) ;
140+ t . equal ( lines [ 0 ] , ".__debug-1 {}" , "has expected class on line 1" ) ;
141+ const consumer = await getConsumer ( msg . css ) ;
142+ const pos = consumer . originalPositionFor ( { line : 1 , column : 0 } ) ;
143+ t . equal ( pos . line , 5 , "mapped line number matches expected" ) ;
144+ t . equal ( pos . column , 0 , "mapped column matches expected" ) ;
145+ t . equal (
146+ pos . source ,
147+ "webpack:///client.js?n=0" ,
148+ "mapped source matches expected" ,
149+ ) ;
150+ const content = consumer . sourceContentFor ( "webpack:///client.js?n=0" ) ;
151+ t . equal (
152+ content ,
153+ fixtures . clientSource ,
154+ "mapped source content matches expected" ,
155+ ) ;
156+ await browser . close ( ) ;
157+ server . close ( ) ;
158+ t . end ( ) ;
159+ }
160+ } ,
161+ ( ) => {
162+ t . fail ( "Recieved error" ) ;
163+ } ,
164+ ) ;
159165 page . evaluate ( ( ) => {
160166 window . worker . postMessage ( {
161167 id : "init_wasm" ,
0 commit comments