astro/packages/integrations/cloudflare/test/directory.test.js
Nacho Vazquez 45b41d98f5
fix: use the root of the project as the functions location (#6075)
* fix: use the root of the project as the functions location
* test: add test to check where the functions folder is added
2023-02-03 16:19:44 +01:00

21 lines
555 B
JavaScript

import { loadFixture } from './test-utils.js';
import { expect } from 'chai';
import cloudflare from '../dist/index.js';
/** @type {import('./test-utils').Fixture} */
describe('mode: "directory"', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
root: './fixtures/basics/',
output: 'server',
adapter: cloudflare({ mode: 'directory' }),
});
await fixture.build();
});
it('generates functions folder inside the project root', async () => {
expect(await fixture.pathExists('../functions')).to.be.true;
});
});