diff options
Diffstat (limited to 'packages/astro/test/error-build-location.test.js')
-rw-r--r-- | packages/astro/test/error-build-location.test.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/astro/test/error-build-location.test.js b/packages/astro/test/error-build-location.test.js new file mode 100644 index 000000000..ed94c678f --- /dev/null +++ b/packages/astro/test/error-build-location.test.js @@ -0,0 +1,23 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; +import { loadFixture } from './test-utils.js'; + +describe('Errors information in build', () => { + /** @type {import('./test-utils').Fixture} */ + let fixture; + + it('includes the file where the error happened', async () => { + fixture = await loadFixture({ + root: './fixtures/error-build-location', + }); + + let errorContent; + try { + await fixture.build(); + } catch (e) { + errorContent = e; + } + + assert.equal(errorContent.id, 'src/pages/index.astro'); + }); +}); |