6fd161d769
* Start of work on astroConfig.mode === 'server' * Add tests and more * adapter -> deploy in some places * Add fallback for `adapter` config * Update more tests * Update image tests * Fix clientAddress test * Updates based on PR review * Add a changeset * Update integrations tests + readme * Oops * Remove old option * Rename `mode` to `output` * Update Node adapter test * Update test * fred pass * fred pass * fred pass * fix test Co-authored-by: Fred K. Schott <fkschott@gmail.com>
32 lines
891 B
JavaScript
32 lines
891 B
JavaScript
import { expect } from 'chai';
|
|
import { load as cheerioLoad } from 'cheerio';
|
|
import { loadFixture } from './test-utils.js';
|
|
import testAdapter from './test-adapter.js';
|
|
|
|
describe('Markdown pages in SSR', () => {
|
|
/** @type {import('./test-utils').Fixture} */
|
|
let fixture;
|
|
|
|
before(async () => {
|
|
fixture = await loadFixture({
|
|
root: './fixtures/ssr-markdown/',
|
|
output: 'server',
|
|
adapter: testAdapter(),
|
|
});
|
|
await fixture.build();
|
|
});
|
|
|
|
async function fetchHTML(path) {
|
|
const app = await fixture.loadTestAdapterApp();
|
|
const request = new Request('http://example.com' + path);
|
|
const response = await app.render(request);
|
|
const html = await response.text();
|
|
return html;
|
|
}
|
|
|
|
it('Renders markdown pages correctly', async () => {
|
|
const html = await fetchHTML('/post');
|
|
const $ = cheerioLoad(html);
|
|
expect($('#subheading').text()).to.equal('Subheading');
|
|
});
|
|
});
|