summaryrefslogtreecommitdiff
path: root/test/snowpack-integration.test.js
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-04-14 13:21:25 -0600
committerGravatar GitHub <noreply@github.com> 2021-04-14 13:21:25 -0600
commit034674c88c5eab59d1cf8883951daa60693fb95c (patch)
tree603f2e7e6e1e825f303c36ca1b72cccd3caba43d /test/snowpack-integration.test.js
parentec75312a153424a47e05d72d41f4c3152cc7ad09 (diff)
downloadastro-034674c88c5eab59d1cf8883951daa60693fb95c.tar.gz
astro-034674c88c5eab59d1cf8883951daa60693fb95c.tar.zst
astro-034674c88c5eab59d1cf8883951daa60693fb95c.zip
Add Windows Support (#93)
* Add Windows to test suite * Try implicit URL
Diffstat (limited to 'test/snowpack-integration.test.js')
-rw-r--r--test/snowpack-integration.test.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/snowpack-integration.test.js b/test/snowpack-integration.test.js
index 2583aab5e..9a29bf16e 100644
--- a/test/snowpack-integration.test.js
+++ b/test/snowpack-integration.test.js
@@ -1,3 +1,4 @@
+import { fileURLToPath } from 'url';
import { suite } from 'uvu';
import * as assert from 'uvu/assert';
import { createRuntime } from '../lib/runtime.js';
@@ -15,9 +16,9 @@ let runtime, cwd, setupError;
SnowpackDev.before(async () => {
// Bug: Snowpack config is still loaded relative to the current working directory.
cwd = process.cwd();
- process.chdir(new URL('../examples/snowpack/', import.meta.url).pathname);
+ process.chdir(fileURLToPath(new URL('../examples/snowpack/', import.meta.url)));
- const astroConfig = await loadConfig(new URL('../examples/snowpack', import.meta.url).pathname);
+ const astroConfig = await loadConfig(fileURLToPath(new URL('../examples/snowpack', import.meta.url)));
const logging = {
level: 'error',
@@ -53,9 +54,11 @@ async function* allPageFiles(root) {
/** create an iterator for all pages and yield the relative paths */
async function* allPages(root) {
for await (let fileURL of allPageFiles(root)) {
- let bare = fileURL.pathname.replace(/\.(astro|md)$/, '').replace(/index$/, '');
+ let bare = fileURLToPath(fileURL)
+ .replace(/\.(astro|md)$/, '')
+ .replace(/index$/, '');
- yield '/' + pathRelative(root.pathname, bare);
+ yield '/' + pathRelative(fileURLToPath(root), bare);
}
}