astro/packages/astro/test/markdown.test.js
Fred K. Schott 6386c14d00
Astro Integration System (#2820)
* update examples

* add initial integrations

* update tests

* update astro

* update ci

* get final tests working

* update injectelement todo

* update ben code review

* respond to final code review feedback
2022-03-18 15:35:45 -07:00

30 lines
851 B
JavaScript

import { expect } from 'chai';
import cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
describe('Markdown tests', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
projectRoot: './fixtures/markdown/',
});
await fixture.build();
});
it('Can load a simple markdown page with Astro', async () => {
const html = await fixture.readFile('/post/index.html');
const $ = cheerio.load(html);
expect($('p').first().text()).to.equal('Hello world!');
expect($('#first').text()).to.equal('Some content');
expect($('#interesting-topic').text()).to.equal('Interesting Topic');
});
it('Can load a realworld markdown page with Astro', async () => {
const html = await fixture.readFile('/realworld/index.html');
const $ = cheerio.load(html);
expect($('pre')).to.have.lengthOf(7);
});
});