astro/packages/astro/test/astro-components.test.js
Drew Powers 272769d723
Improve asset resolution in Astro (#437)
* Improve asset resolution in Astro

Fixes #96

* Add docs, changeset

* Fix collection resolution
2021-06-15 14:53:16 -06:00

29 lines
887 B
JavaScript

import { suite } from 'uvu';
import * as assert from 'uvu/assert';
import { doc } from './test-utils.js';
import { setup, setupBuild } from './helpers.js';
const Components = suite('Components tests');
setup(Components, './fixtures/astro-components');
Components('Astro components are able to render framework components', async ({ runtime }) => {
let result = await runtime.load('/');
if (result.error) throw new Error(result);
const $ = doc(result.contents);
const $astro = $('#astro');
assert.equal($astro.children().length, 3, 'Renders astro component');
const $react = $('#react');
assert.not.type($react, 'undefined', 'Renders React component');
const $vue = $('#vue');
assert.not.type($vue, 'undefined', 'Renders Vue component');
const $svelte = $('#svelte');
assert.not.type($svelte, 'undefined', 'Renders Svelte component');
});
Components.run();