mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
1a59185ddd
* initial commit * try to fix windows * output files directly into the correct folder * allow for rest parameters * use fixed hook * improve tests * apply doc's team suggestions for README Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * try to fix prerendering * apply doc's team suggestion for changeset Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * bump to minor * readme update * resolve review comments * optimize memory allocation * resolve review comments * add removed link, to make sure old docs keep same * resolve comment Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
import { loadFixture } from './test-utils.js';
|
|
import { expect } from 'chai';
|
|
import cloudflare from '../dist/index.js';
|
|
|
|
/** @type {import('./test-utils').Fixture} */
|
|
describe('Cloudflare SSR split', () => {
|
|
let fixture;
|
|
|
|
before(async () => {
|
|
fixture = await loadFixture({
|
|
root: './fixtures/split/',
|
|
adapter: cloudflare({ mode: 'directory' }),
|
|
output: "server",
|
|
build: {
|
|
split: true,
|
|
excludeMiddleware: false
|
|
},
|
|
vite: {
|
|
build: {
|
|
minify: false,
|
|
},
|
|
},
|
|
});
|
|
await fixture.build();
|
|
});
|
|
|
|
after(() => {
|
|
fixture.clean();
|
|
});
|
|
|
|
it('generates functions folders inside the project root, and checks that each page is emitted by astro', async () => {
|
|
expect(await fixture.pathExists('../functions')).to.be.true;
|
|
expect(await fixture.pathExists('../functions/index.js')).to.be.true;
|
|
expect(await fixture.pathExists('../functions/blog/cool.js')).to.be.true;
|
|
expect(await fixture.pathExists('../functions/blog/[post].js')).to.be.true;
|
|
expect(await fixture.pathExists('../functions/[person]/[car].js')).to.be.true;
|
|
expect(await fixture.pathExists('../functions/files/[[path]].js')).to.be.true;
|
|
expect(await fixture.pathExists('../functions/[language]/files/[[path]].js')).to.be.true;
|
|
});
|
|
|
|
it('generates pre-rendered files', async () => {
|
|
expect(await fixture.pathExists('./prerender/index.html')).to.be.true;
|
|
});
|
|
});
|