From c9eda23cd32168db8deafdef2dbc726d60ff5556 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Mon, 16 Dec 2024 13:58:56 -0500 Subject: [PATCH] Update test to look at frontend sourcemaps --- packages/astro/test/sourcemap.test.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/astro/test/sourcemap.test.js b/packages/astro/test/sourcemap.test.js index a1e657dbd1fc..36cd071a6b98 100644 --- a/packages/astro/test/sourcemap.test.js +++ b/packages/astro/test/sourcemap.test.js @@ -17,7 +17,13 @@ describe('Sourcemap', async () => { }); it('Builds non-empty sourcemap', async () => { - const map = await fixture.readFile('renderers.mjs.map'); - assert.equal(map.includes('"sources":[]'), false); + const assets = await fixture.readdir('/_astro'); + const maps = assets.filter(file => file.endsWith('.map')); + assert.ok(maps.length > 0, 'got source maps'); + for(const mapName of maps) { + const filename = `/_astro/${mapName}`; + const map = await fixture.readFile(filename); + assert.equal(map.includes('"sources":[]'), false); + } }); });