Skip to content

Commit

Permalink
test: update error test for [email protected] (withastro#2877)
Browse files Browse the repository at this point in the history
* test: update error test for [email protected]

* chore: add link to old tests
  • Loading branch information
natemoo-re committed Mar 24, 2022
1 parent 451f3d4 commit 2053231
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions test/errors.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isWindows, loadFixture } from './test-utils.js';
import { expect } from 'chai';

describe('Error display', () => {
if (isWindows) return;
Expand All @@ -12,15 +13,21 @@ describe('Error display', () => {
});
});

describe('Astro', () => {
it('properly detect syntax errors in template', async () => {
try {
devServer = await fixture.startDevServer();
} catch (err) {
return;
}
await devServer.stop();
throw new Error('Expected to throw on startup');
});
describe('Astro', async () => {
// This test is skipped because it will hang on [email protected]
// TODO: unskip test once [email protected] lands
// See pre-integration system test: https://github.com/withastro/astro/blob/0f376a7c52d3a22ff32b33e0afc34dd306ed70c4/packages/astro/test/errors.test.js
it.skip('properly detect syntax errors in template', async () => {
try {
devServer = await fixture.startDevServer();
} catch (err) {
return;
}

// This is new behavior in [email protected], previously the server would throw on startup
const res = await fixture.fetch('/astro-syntax-error');
await devServer.stop();
expect(res.status).to.equal(500, `Successfully responded with 500 Error for invalid file`);
});
});
});

0 comments on commit 2053231

Please sign in to comment.