Skip to content

Commit

Permalink
Update test to look at frontend sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Dec 16, 2024
1 parent 291c4a7 commit c9eda23
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/astro/test/sourcemap.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
});

0 comments on commit c9eda23

Please sign in to comment.