2023-02-21 14:14:47 +00:00
|
|
|
import { expect } from 'chai';
|
2023-05-02 07:42:48 +00:00
|
|
|
import { loadFixture } from './test-utils.js';
|
2023-02-21 14:14:47 +00:00
|
|
|
|
|
|
|
describe('Serverless prerender', () => {
|
|
|
|
/** @type {import('./test-utils').Fixture} */
|
|
|
|
let fixture;
|
|
|
|
|
|
|
|
before(async () => {
|
2023-05-17 13:23:20 +00:00
|
|
|
process.env.PRERENDER = true;
|
2023-02-21 14:14:47 +00:00
|
|
|
fixture = await loadFixture({
|
|
|
|
root: './fixtures/serverless-prerender/',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('build successful', async () => {
|
|
|
|
await fixture.build();
|
2023-05-02 07:42:48 +00:00
|
|
|
expect(await fixture.readFile('../.vercel/output/static/index.html')).to.be.ok;
|
2023-02-21 14:14:47 +00:00
|
|
|
});
|
|
|
|
});
|
2023-05-17 13:23:20 +00:00
|
|
|
|
|
|
|
describe('Serverless hybrid rendering', () => {
|
|
|
|
/** @type {import('./test-utils').Fixture} */
|
|
|
|
let fixture;
|
|
|
|
|
|
|
|
before(async () => {
|
|
|
|
process.env.PRERENDER = true;
|
|
|
|
fixture = await loadFixture({
|
|
|
|
root: './fixtures/serverless-prerender/',
|
2023-05-17 13:26:03 +00:00
|
|
|
output: 'hybrid',
|
|
|
|
experimental: {
|
|
|
|
hybridOutput: true,
|
|
|
|
},
|
2023-05-17 13:23:20 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('build successful', async () => {
|
|
|
|
await fixture.build();
|
|
|
|
expect(await fixture.readFile('../.vercel/output/static/index.html')).to.be.ok;
|
|
|
|
});
|
|
|
|
});
|