diff options
Diffstat (limited to 'packages/astro/test/static-build-dir.test.js')
-rw-r--r-- | packages/astro/test/static-build-dir.test.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/astro/test/static-build-dir.test.js b/packages/astro/test/static-build-dir.test.js new file mode 100644 index 000000000..d09756af2 --- /dev/null +++ b/packages/astro/test/static-build-dir.test.js @@ -0,0 +1,29 @@ +import { expect } from 'chai'; +import { loadFixture } from './test-utils.js'; + +describe('Static build: dir takes the URL path to the output directory', () => { + /** @type {URL} */ + let checkDir; + before(async () => { + const fixture = await loadFixture({ + root: './fixtures/static-build-dir/', + integrations: [ + { + name: '@astrojs/dir', + hooks: { + 'astro:build:done': ({ dir }) => { + checkDir = dir; + }, + }, + }, + ], + }); + await fixture.build(); + }); + it('dir takes the URL path to the output directory', async () => { + const removeTrailingSlash = (str) => str.replace(/\/$/, ''); + expect(removeTrailingSlash(checkDir.toString())).to.be.equal( + removeTrailingSlash(new URL('./fixtures/static-build-dir/dist', import.meta.url).toString()) + ); + }); +}); |