diff options
author | 2021-09-16 13:06:43 -0700 | |
---|---|---|
committer | 2021-09-16 13:06:43 -0700 | |
commit | 291f2ef537dea2aa5a190d2a9661148d39bf3099 (patch) | |
tree | b76dadb5645f6f4a8a6b6af5342aa699244ea2f2 /packages/astro/test/integration-docs.test.js | |
parent | b0a7e79bd0d7a22e714b9ab22264eacaf746c8ad (diff) | |
download | astro-291f2ef537dea2aa5a190d2a9661148d39bf3099.tar.gz astro-291f2ef537dea2aa5a190d2a9661148d39bf3099.tar.zst astro-291f2ef537dea2aa5a190d2a9661148d39bf3099.zip |
fix bad benchmark (#1383)
Diffstat (limited to '')
-rw-r--r-- | packages/astro/test/integration-docs.test.js (renamed from packages/astro/test/snowpack-integration.test.js) | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/packages/astro/test/snowpack-integration.test.js b/packages/astro/test/integration-docs.test.js index 24388c49b..7140b9280 100644 --- a/packages/astro/test/snowpack-integration.test.js +++ b/packages/astro/test/integration-docs.test.js @@ -5,8 +5,8 @@ import { suite } from 'uvu'; import * as assert from 'uvu/assert'; import { setup } from './helpers.js'; -const SnowpackDev = suite('snowpack.dev'); -setup(SnowpackDev, '../../../examples/snowpack'); +const SnowpackDev = suite('docs.astro.build'); +setup(SnowpackDev, '../../../docs'); // convert file path to its final url function formatURL(filepath) { @@ -17,9 +17,8 @@ function formatURL(filepath) { } // declaring routes individually helps us run many quick tests rather than one giant slow test -const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '../../../examples/snowpack/src/pages'); +const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '../../../docs/src/pages'); let pages = glob('**/*.{astro,md}', { cwd: root, onlyFiles: true }) - .filter((page) => !page.includes('proof-of-concept-dynamic')) .map(formatURL); SnowpackDev('Pages successfully scanned', () => { @@ -29,9 +28,16 @@ SnowpackDev('Pages successfully scanned', () => { for (const pathname of pages) { SnowpackDev(`Loads "${pathname}"`, async ({ runtime }) => { const result = await runtime.load(pathname); + if (result.statusCode !== 200) { + console.error(result); + } assert.equal(result.statusCode, 200); return; }); } -SnowpackDev.run(); + +// Skipped on Node <v14 +if (process.env.NODE_VERSION > '14') { + SnowpackDev.run(); +}
\ No newline at end of file |