Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update error test for [email protected] #2877

Merged
merged 2 commits into from
Mar 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: update error test for [email protected]
  • Loading branch information
Nate Moore committed Mar 24, 2022
commit ed3112aa043be003d53b1853aad525928b1253f5
26 changes: 16 additions & 10 deletions packages/astro/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,20 @@ 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
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`);
});
});
});