0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/integrations/image/test/no-alt-text-image-ssg.test.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
701 B
JavaScript
Raw Normal View History

import { expect } from 'chai';
import { loadFixture } from './test-utils.js';
let fixture;
const errorMessage =
'The <Image> component requires you provide alt text. If this image does not require an accessible label, set alt="".';
/** TODO: enable the test once missing alt text throws an error instead of a console warning */
describe.skip('SSG image without alt text', function () {
before(async () => {
fixture = await loadFixture({ root: './fixtures/no-alt-text-image/' });
});
it('throws during build', async () => {
try {
await fixture.build();
} catch (err) {
expect(err.message).to.equal(errorMessage);
return;
}
expect.fail(0, 1, 'Exception not thrown');
});
});