astro/packages/astro/test/astro-pages.test.js
2021-12-22 16:11:05 -05:00

19 lines
520 B
JavaScript

import { expect } from 'chai';
import cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
describe('Pages', () => {
let fixture;
before(async () => {
fixture = await loadFixture({ projectRoot: './fixtures/astro-pages/' });
await fixture.build();
});
it('Can find page with "index" at the end file name', async () => {
const html = await fixture.readFile('/posts/name-with-index/index.html');
const $ = cheerio.load(html);
expect($('h1').text()).to.equal('Name with index');
});
});