diff options
author | 2022-09-15 21:02:07 +0000 | |
---|---|---|
committer | 2022-09-15 21:02:07 +0000 | |
commit | 03b18e8d1b9b88d7e9b22e15809a78cc222cb55b (patch) | |
tree | 4d111983ff1db2db5d92418929dc7832b7f75f2d /packages/astro/test/static-build-dir.test.js | |
parent | b2da8a124a03ce58dbca7df7ae1d68019f6637cc (diff) | |
download | astro-03b18e8d1b9b88d7e9b22e15809a78cc222cb55b.tar.gz astro-03b18e8d1b9b88d7e9b22e15809a78cc222cb55b.tar.zst astro-03b18e8d1b9b88d7e9b22e15809a78cc222cb55b.zip |
Adds a new "astro:build:generated" hook for SSG builds (#4772)
* adds a new "astro:build:generated" hook for SSG builds
* chore: add changeset
Diffstat (limited to '')
-rw-r--r-- | packages/astro/test/static-build-dir.test.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/astro/test/static-build-dir.test.js b/packages/astro/test/static-build-dir.test.js index d09756af2..d6a8c90c3 100644 --- a/packages/astro/test/static-build-dir.test.js +++ b/packages/astro/test/static-build-dir.test.js @@ -4,6 +4,8 @@ import { loadFixture } from './test-utils.js'; describe('Static build: dir takes the URL path to the output directory', () => { /** @type {URL} */ let checkDir; + /** @type {URL} */ + let checkGeneratedDir; before(async () => { const fixture = await loadFixture({ root: './fixtures/static-build-dir/', @@ -11,6 +13,9 @@ describe('Static build: dir takes the URL path to the output directory', () => { { name: '@astrojs/dir', hooks: { + 'astro:build:generated': ({ dir }) => { + checkGeneratedDir = dir; + }, 'astro:build:done': ({ dir }) => { checkDir = dir; }, @@ -25,5 +30,6 @@ describe('Static build: dir takes the URL path to the output directory', () => { expect(removeTrailingSlash(checkDir.toString())).to.be.equal( removeTrailingSlash(new URL('./fixtures/static-build-dir/dist', import.meta.url).toString()) ); + expect(checkDir.toString()).to.be.equal(checkGeneratedDir.toString()); }); }); |