diff options
Diffstat (limited to '')
-rw-r--r-- | packages/integrations/cloudflare/test/with-base-path.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/integrations/cloudflare/test/with-base-path.js b/packages/integrations/cloudflare/test/with-base-path.js new file mode 100644 index 000000000..6ea82b2fb --- /dev/null +++ b/packages/integrations/cloudflare/test/with-base-path.js @@ -0,0 +1,22 @@ +// @ts-check +import * as assert from 'node:assert/strict'; +import { before, describe, it } from 'node:test'; +import { fileURLToPath } from 'node:url'; +import { astroCli } from './_test-utils.js'; +import { existsSync, promises as fs } from 'node:fs'; + +const root = new URL('./fixtures/with-base/', import.meta.url); + +describe('With base', () => { + before(async () => { + await fs.rm(new URL('dist/', root), { recursive: true, force: true }); + await astroCli(fileURLToPath(root), 'build'); + }); + + it('generates platform files in the correct directory', async () => { + for (const file of ['_redirects', '_routes.json', 'blog/static/index.html']) { + assert.ok(existsSync(new URL(`dist/${file}`, root))); + } + }); +}); + |