astro/packages/astro/test/reexport-astro-containing-client-component.test.js
Matthew Phillips f5afaf2498
Support re-exporting astro components containing client components (#3625)
* Support re-exporting astro components containing client components

* Include metadata for markdown too

* Fix ssr, probably

* Inject post-build

* Remove tagName custom element test

* Allows using the constructor for lit elements

* Fix hoisted script scanning

* Pass through plugin context

* Get edge functions working in the edge tests

* Fix types for the edge function integration

* Upgrade the compiler

* Upgrade compiler version

* Better release notes for lit

* Update .changeset/unlucky-hairs-camp.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* Properly test that the draft was not rendered

* Prevent from rendering draft posts

* Add a changeset about the build perf improvement.

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-21 08:32:05 -04:00

19 lines
627 B
JavaScript

import { expect } from 'chai';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
describe('Re-exported astro components with client components', () => {
let fixture;
before(async () => {
fixture = await loadFixture({ root: './fixtures/reexport-astro-containing-client-component/' });
await fixture.build();
});
it('Is able to build and renders and stuff', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
expect($('astro-island').length).to.equal(1);
expect($('astro-island').attr('component-export')).to.equal('One');
});
});