0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00
astro/packages/astro/test/sourcemap.test.js
2023-05-23 14:55:34 +01:00

22 lines
615 B
JavaScript

import { expect } from 'chai';
import { loadFixture } from './test-utils.js';
describe('Sourcemap', async () => {
let fixture;
before(async () => {
fixture = await loadFixture({ root: './fixtures/sourcemap/' });
await fixture.build();
});
it('Builds sourcemap', async () => {
const dir = await fixture.readdir('./_astro');
const counterMap = dir.find((file) => file.match(/^Counter\.\w+\.js\.map$/));
expect(counterMap).to.be.ok;
});
it('Builds non-empty sourcemap', async () => {
const map = await fixture.readFile('renderers.mjs.map');
expect(map).to.not.include('"sources":[]');
});
});