summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@matthewphillips.info> 2021-12-23 15:24:02 -0500
committerGravatar GitHub <noreply@github.com> 2021-12-23 15:24:02 -0500
commit991c30a72a7fdde5857870be7be1482d466dbb07 (patch)
tree225498e032bc95dafda90ac9f764e6db2d5d38f8
parent160b45bf4dee2f0998e0c869215b93e1452dd877 (diff)
downloadastro-991c30a72a7fdde5857870be7be1482d466dbb07.tar.gz
astro-991c30a72a7fdde5857870be7be1482d466dbb07.tar.zst
astro-991c30a72a7fdde5857870be7be1482d466dbb07.zip
Don't run dev mode tests on windows (#2262)
* Don't run dev mode tests on windows * Debugging * chore(lint): Prettier fix * remove the throw * Skip a different way * chore(lint): Prettier fix * Skip the error test on windows too * chore(lint): Prettier fix * Move the after into the closure * chore(lint): Prettier fix Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
-rw-r--r--packages/astro/test/errors.test.js40
-rw-r--r--packages/astro/test/react-component.test.js4
-rw-r--r--packages/astro/test/solid-component.test.js4
-rw-r--r--packages/astro/test/svelte-component.test.js4
-rw-r--r--packages/astro/test/test-utils.js3
-rw-r--r--packages/astro/test/vue-component.test.js4
6 files changed, 36 insertions, 23 deletions
diff --git a/packages/astro/test/errors.test.js b/packages/astro/test/errors.test.js
index 32848851c..d85cb9e04 100644
--- a/packages/astro/test/errors.test.js
+++ b/packages/astro/test/errors.test.js
@@ -1,21 +1,27 @@
import { expect } from 'chai';
-import { loadFixture } from './test-utils.js';
-
-let fixture;
-let devServer;
-
-before(async () => {
- fixture = await loadFixture({
- projectRoot: './fixtures/errors',
- renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react', '@astrojs/renderer-solid', '@astrojs/renderer-svelte', '@astrojs/renderer-vue'],
- vite: {
- optimizeDeps: false, // necessary to prevent Vite throwing on bad files
- },
- });
- devServer = await fixture.startDevServer();
-});
+import { isWindows, loadFixture } from './test-utils.js';
describe('Error display', () => {
+ if (isWindows) return;
+
+ let fixture;
+ let devServer;
+
+ before(async () => {
+ fixture = await loadFixture({
+ projectRoot: './fixtures/errors',
+ renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react', '@astrojs/renderer-solid', '@astrojs/renderer-svelte', '@astrojs/renderer-vue'],
+ vite: {
+ optimizeDeps: false, // necessary to prevent Vite throwing on bad files
+ },
+ });
+ devServer = await fixture.startDevServer();
+ });
+
+ after(async () => {
+ await devServer.stop();
+ });
+
describe('Astro', () => {
it('syntax error in template', async () => {
const res = await fixture.fetch('/astro-syntax-error');
@@ -200,7 +206,3 @@ describe('Error display', () => {
});
});
});
-
-after(async () => {
- await devServer.stop();
-});
diff --git a/packages/astro/test/react-component.test.js b/packages/astro/test/react-component.test.js
index 4e237508c..fcfab827e 100644
--- a/packages/astro/test/react-component.test.js
+++ b/packages/astro/test/react-component.test.js
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import cheerio from 'cheerio';
-import { loadFixture } from './test-utils.js';
+import { isWindows, loadFixture } from './test-utils.js';
let fixture;
@@ -75,6 +75,8 @@ describe('React Components', () => {
});
});
+ if (isWindows) return;
+
describe('dev', () => {
let devServer;
diff --git a/packages/astro/test/solid-component.test.js b/packages/astro/test/solid-component.test.js
index fa7172d31..8b76e9f6f 100644
--- a/packages/astro/test/solid-component.test.js
+++ b/packages/astro/test/solid-component.test.js
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import cheerio from 'cheerio';
-import { loadFixture } from './test-utils.js';
+import { isWindows, loadFixture } from './test-utils.js';
describe('Solid component', () => {
let fixture;
@@ -29,6 +29,8 @@ describe('Solid component', () => {
});
});
+ if (isWindows) return;
+
describe('dev', () => {
let devServer;
diff --git a/packages/astro/test/svelte-component.test.js b/packages/astro/test/svelte-component.test.js
index ef350af4d..edf6e3965 100644
--- a/packages/astro/test/svelte-component.test.js
+++ b/packages/astro/test/svelte-component.test.js
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import cheerio from 'cheerio';
-import { loadFixture } from './test-utils.js';
+import { isWindows, loadFixture } from './test-utils.js';
describe('Svelte component', () => {
let fixture;
@@ -28,6 +28,8 @@ describe('Svelte component', () => {
});
});
+ if (isWindows) return;
+
describe('dev', () => {
let devServer;
diff --git a/packages/astro/test/test-utils.js b/packages/astro/test/test-utils.js
index 49775c3b4..8d8ba9e2c 100644
--- a/packages/astro/test/test-utils.js
+++ b/packages/astro/test/test-utils.js
@@ -6,6 +6,7 @@ import { loadConfig } from '../dist/core/config.js';
import dev from '../dist/core/dev/index.js';
import build from '../dist/core/build/index.js';
import preview from '../dist/core/preview/index.js';
+import os from 'os';
/**
* @typedef {import('node-fetch').Response} Response
* @typedef {import('../src/core/dev/index').DevServer} DevServer
@@ -109,3 +110,5 @@ export function cli(/** @type {string[]} */ ...args) {
return spawned;
}
+
+export const isWindows = os.platform() === 'win32';
diff --git a/packages/astro/test/vue-component.test.js b/packages/astro/test/vue-component.test.js
index a02a85a3f..9cad2ccc3 100644
--- a/packages/astro/test/vue-component.test.js
+++ b/packages/astro/test/vue-component.test.js
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import cheerio from 'cheerio';
-import { loadFixture } from './test-utils.js';
+import { isWindows, loadFixture } from './test-utils.js';
describe('Vue component', () => {
let fixture;
@@ -43,6 +43,8 @@ describe('Vue component', () => {
});
});
+ if (isWindows) return;
+
describe('dev', () => {
let devServer;