Skip to content

Commit

Permalink
Fix test on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Jun 22, 2023
1 parent 32618c6 commit cef3a44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/astro/src/core/render/dev/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export async function* crawlGraph(

// Virtual modules URL should start with /@id/ but do not
function urlId(url: string) {
if(url[0] !== '/') {
if (url.startsWith('astro:scripts')) {
return '/@id/' + url;
}
return url;
Expand Down
5 changes: 3 additions & 2 deletions packages/astro/test/units/dev/styles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { fileURLToPath } from 'url';
import {
getStylesForURL
} from '../../../dist/core/render/dev/css.js';
import { viteID } from '../../../dist/core/util.js';

const root = new URL('../../fixtures/alias/', import.meta.url);

Expand All @@ -22,8 +23,8 @@ class TestLoader {
describe('Crawling graph for CSS', () => {
let loader;
before(() => {
const indexId = fileURLToPath(new URL('./src/pages/index.astro', root));
const aboutId = fileURLToPath(new URL('./src/pages/about.astro', root));
const indexId = viteID(new URL('./src/pages/index.astro', root));
const aboutId = viteID(new URL('./src/pages/about.astro', root));
loader = new TestLoader([
{
id: indexId,
Expand Down

0 comments on commit cef3a44

Please sign in to comment.