test-utils.js 588 B

12345678910111213141516
  1. import { loadFixture as baseLoadFixture } from '../../../astro/test/test-utils.js';
  2. /**
  3. * @typedef {import('../../../astro/test/test-utils').Fixture} Fixture
  4. */
  5. export function loadFixture(inlineConfig) {
  6. if (!inlineConfig?.root) throw new Error("Must provide { root: './fixtures/...' }");
  7. // resolve the relative root (i.e. "./fixtures/tailwindcss") to a full filepath
  8. // without this, the main `loadFixture` helper will resolve relative to `packages/astro/test`
  9. return baseLoadFixture({
  10. ...inlineConfig,
  11. root: new URL(inlineConfig.root, import.meta.url).toString(),
  12. });
  13. }