[ci] format
This commit is contained in:
parent
c20b93c484
commit
0d3a7de527
3 changed files with 10 additions and 11 deletions
|
@ -30,11 +30,11 @@ test.describe('TypeScript resolution -', () => {
|
||||||
const t = test.extend({});
|
const t = test.extend({});
|
||||||
|
|
||||||
let devServer;
|
let devServer;
|
||||||
|
|
||||||
t.beforeEach(async ({ astro }) => {
|
t.beforeEach(async ({ astro }) => {
|
||||||
devServer = await astro.startDevServer();
|
devServer = await astro.startDevServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
t.afterEach(async () => {
|
t.afterEach(async () => {
|
||||||
await devServer.stop();
|
await devServer.stop();
|
||||||
});
|
});
|
||||||
|
@ -49,16 +49,16 @@ test.describe('TypeScript resolution -', () => {
|
||||||
|
|
||||||
t.beforeAll(async ({ astro }) => {
|
t.beforeAll(async ({ astro }) => {
|
||||||
await astro.build();
|
await astro.build();
|
||||||
})
|
});
|
||||||
|
|
||||||
t.beforeEach(async ({ astro }) => {
|
t.beforeEach(async ({ astro }) => {
|
||||||
previewServer = await astro.preview();
|
previewServer = await astro.preview();
|
||||||
});
|
});
|
||||||
|
|
||||||
t.afterEach(async () => {
|
t.afterEach(async () => {
|
||||||
await previewServer.stop();
|
await previewServer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
runTest(t);
|
runTest(t);
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
|
|
||||||
export function resolveClientDevPath(id: string) {
|
export function resolveClientDevPath(id: string) {
|
||||||
if(id.startsWith('/@fs')) {
|
if (id.startsWith('/@fs')) {
|
||||||
// Vite does not resolve .jsx -> .tsx when coming from the client, so clip the extension.
|
// Vite does not resolve .jsx -> .tsx when coming from the client, so clip the extension.
|
||||||
if(id.endsWith('.jsx')) {
|
if (id.endsWith('.jsx')) {
|
||||||
return id.slice(0, id.length - 4);
|
return id.slice(0, id.length - 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,10 +37,10 @@ export class Metadata {
|
||||||
}
|
}
|
||||||
|
|
||||||
resolvePath(specifier: string): string {
|
resolvePath(specifier: string): string {
|
||||||
if(specifier.startsWith('.')) {
|
if (specifier.startsWith('.')) {
|
||||||
const resolved = new URL(specifier, this.mockURL).pathname;
|
const resolved = new URL(specifier, this.mockURL).pathname;
|
||||||
// Vite does not resolve .jsx -> .tsx when coming from the client, so clip the extension.
|
// Vite does not resolve .jsx -> .tsx when coming from the client, so clip the extension.
|
||||||
if(resolved.startsWith('/@fs') && resolved.endsWith('.jsx')) {
|
if (resolved.startsWith('/@fs') && resolved.endsWith('.jsx')) {
|
||||||
return resolved.slice(0, resolved.length - 4);
|
return resolved.slice(0, resolved.length - 4);
|
||||||
}
|
}
|
||||||
return resolved;
|
return resolved;
|
||||||
|
|
Loading…
Reference in a new issue