diff options
| author | 2023-08-15 09:24:06 +0100 | |
|---|---|---|
| committer | 2023-08-15 09:24:06 +0100 | |
| commit | 30cb576a4cc4fb9ee83a99007dbe7a1e2751c7cc (patch) | |
| tree | ab99d7612a92ba258197c60e706cc75b6d0d68ed /packages/integrations/netlify/test/functions/builders.test.js | |
| parent | e1d735b5e8671c6ed2236ded0c0b19056bf24645 (diff) | |
| parent | f2e1664b3e4bf731ca0ed7ee3138f8b6cd3169ab (diff) | |
| download | astro-30cb576a4cc4fb9ee83a99007dbe7a1e2751c7cc.tar.gz astro-30cb576a4cc4fb9ee83a99007dbe7a1e2751c7cc.tar.zst astro-30cb576a4cc4fb9ee83a99007dbe7a1e2751c7cc.zip | |
Merge remote-tracking branch 'origin/main' into next
Diffstat (limited to 'packages/integrations/netlify/test/functions/builders.test.js')
| -rw-r--r-- | packages/integrations/netlify/test/functions/builders.test.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/packages/integrations/netlify/test/functions/builders.test.js b/packages/integrations/netlify/test/functions/builders.test.js new file mode 100644 index 000000000..d47af92c0 --- /dev/null +++ b/packages/integrations/netlify/test/functions/builders.test.js @@ -0,0 +1,37 @@ +import { expect } from 'chai'; +import { loadFixture, testIntegration } from './test-utils.js'; +import netlifyAdapter from '../../dist/index.js'; + +describe('Builders', () => { + /** @type {import('../../../astro/test/test-utils').Fixture} */ + let fixture; + + before(async () => { + fixture = await loadFixture({ + root: new URL('./fixtures/builders/', import.meta.url).toString(), + output: 'server', + adapter: netlifyAdapter({ + dist: new URL('./fixtures/builders/dist/', import.meta.url), + builders: true, + }), + site: `http://example.com`, + integrations: [testIntegration()], + }); + await fixture.build(); + }); + + it('A route can set builders ttl', async () => { + const entryURL = new URL( + './fixtures/builders/.netlify/functions-internal/entry.mjs', + import.meta.url + ); + const { handler } = await import(entryURL); + const resp = await handler({ + httpMethod: 'GET', + headers: {}, + rawUrl: 'http://example.com/', + isBase64Encoded: false, + }); + expect(resp.ttl).to.equal(45); + }); +}); |
