diff options
author | 2024-03-28 09:17:53 +0100 | |
---|---|---|
committer | 2024-03-28 09:17:53 +0100 | |
commit | 8ef3050f1461bb824f095af5157624bfb68ef63c (patch) | |
tree | fa14f03b307c4fea4218f89ce75fceea48790a81 /packages/integrations/cloudflare/test/function-per-route.test.js | |
parent | 08f6167c012a2c61da5055f350acdf62a8b12b8f (diff) | |
download | astro-8ef3050f1461bb824f095af5157624bfb68ef63c.tar.gz astro-8ef3050f1461bb824f095af5157624bfb68ef63c.tar.zst astro-8ef3050f1461bb824f095af5157624bfb68ef63c.zip |
feat(cloudflare): major refactor for v10 (#159)
Co-authored-by: Matthew Phillips <361671+matthewp@users.noreply.github.com>
Co-authored-by: Emanuele Stoppa <602478+ematipico@users.noreply.github.com>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Diffstat (limited to 'packages/integrations/cloudflare/test/function-per-route.test.js')
-rw-r--r-- | packages/integrations/cloudflare/test/function-per-route.test.js | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/packages/integrations/cloudflare/test/function-per-route.test.js b/packages/integrations/cloudflare/test/function-per-route.test.js deleted file mode 100644 index 55d23e2ed..000000000 --- a/packages/integrations/cloudflare/test/function-per-route.test.js +++ /dev/null @@ -1,37 +0,0 @@ -import * as assert from 'node:assert/strict'; -import { existsSync } from 'node:fs'; -import { before, describe, it } from 'node:test'; -import { fileURLToPath } from 'node:url'; -import { astroCli } from './_test-utils.js'; - -const root = new URL('./fixtures/function-per-route/', import.meta.url); - -describe('Function per Route', () => { - before(async () => { - await astroCli(fileURLToPath(root), 'build'); - }); - - it('generates functions folder inside the project root', () => { - const testURL = new URL('functions', root); - assert.equal(existsSync(fileURLToPath(testURL)), true); - }); - - it('generates functions bundles for each page', () => { - assert.equal(existsSync(fileURLToPath(new URL('functions/index.js', root))), true); - assert.equal(existsSync(fileURLToPath(new URL('functions/blog/cool.js', root))), true); - assert.equal(existsSync(fileURLToPath(new URL('functions/blog/[post].js', root))), true); - assert.equal(existsSync(fileURLToPath(new URL('functions/[person]/[car].js', root))), true); - assert.equal(existsSync(fileURLToPath(new URL('functions/files/[[path]].js', root))), true); - assert.equal( - existsSync(fileURLToPath(new URL('functions/[language]/files/[[path]].js', root))), - true - ); - assert.equal(existsSync(fileURLToPath(new URL('functions/trpc/[trpc].js', root))), true); - assert.equal(existsSync(fileURLToPath(new URL('functions/javascript.js', root))), true); - assert.equal(existsSync(fileURLToPath(new URL('functions/test.json.js', root))), true); - }); - - it('generates html files for pre-rendered routes', () => { - assert.equal(existsSync(fileURLToPath(new URL('dist/prerender/index.html', root))), true); - }); -}); |