mdx-infinite-loop.test.js 658 B

12345678910111213141516171819202122232425262728293031
  1. import mdx from '@astrojs/mdx';
  2. import { describe, it, before } from 'node:test';
  3. import * as assert from 'node:assert/strict';
  4. import { loadFixture } from '../../../astro/test/test-utils.js';
  5. describe('MDX Infinite Loop', () => {
  6. let fixture;
  7. before(async () => {
  8. fixture = await loadFixture({
  9. root: new URL('./fixtures/mdx-infinite-loop/', import.meta.url),
  10. integrations: [mdx()],
  11. });
  12. });
  13. describe('build', () => {
  14. let err;
  15. before(async () => {
  16. try {
  17. await fixture.build();
  18. } catch (e) {
  19. err = e;
  20. }
  21. });
  22. it('does not hang forever if an error is thrown', async () => {
  23. assert.equal(!!err, true);
  24. });
  25. });
  26. });