summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2022-03-24 14:44:08 -0500
committerGravatar GitHub <noreply@github.com> 2022-03-24 14:44:08 -0500
commita49f0490c0a86de24328e5a8f6427f186bec8717 (patch)
tree6b6041e9c4cedae591087e257cd7abebbf34c8c8
parentbababd84618b1691c712fff878feb048fa85ff8c (diff)
downloadastro-a49f0490c0a86de24328e5a8f6427f186bec8717.tar.gz
astro-a49f0490c0a86de24328e5a8f6427f186bec8717.tar.zst
astro-a49f0490c0a86de24328e5a8f6427f186bec8717.zip
test: update error test for vite@2.9.x (#2877)
* test: update error test for vite@2.9.x * chore: add link to old tests
-rw-r--r--packages/astro/test/errors.test.js27
1 files changed, 17 insertions, 10 deletions
diff --git a/packages/astro/test/errors.test.js b/packages/astro/test/errors.test.js
index 093dd5d8d..b4becb10e 100644
--- a/packages/astro/test/errors.test.js
+++ b/packages/astro/test/errors.test.js
@@ -1,4 +1,5 @@
import { isWindows, loadFixture } from './test-utils.js';
+import { expect } from 'chai';
describe('Error display', () => {
if (isWindows) return;
@@ -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 vite@2.8.x
+ // TODO: unskip test once vite@2.9.x 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 vite@2.9.x, 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`);
+ });
});
});