[ci] format

This commit is contained in:
matthewp 2022-11-17 15:35:15 +00:00 committed by fredkbot
parent 1ab505855f
commit 539ee179f7
3 changed files with 10 additions and 10 deletions

View file

@ -2,8 +2,8 @@ import type fsType from 'fs';
import npath from 'path';
import { pathToFileURL } from 'url';
import * as vite from 'vite';
import { AstroError, AstroErrorData } from '../errors/index.js';
import loadFallbackPlugin from '../../vite-plugin-load-fallback/index.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
// Fallback for legacy
import load from '@proload/core';
@ -28,7 +28,7 @@ async function createViteLoader(root: string, fs: typeof fsType): Promise<ViteLo
// avoid `vite.createServer` and use `loadConfigFromFile` instead.
external: ['@astrojs/tailwind', '@astrojs/mdx', '@astrojs/react'],
},
plugins: [ loadFallbackPlugin({ fs, root: pathToFileURL(root) })]
plugins: [loadFallbackPlugin({ fs, root: pathToFileURL(root) })],
});
return {

View file

@ -2,7 +2,6 @@ import nodeFs from 'fs';
import npath from 'path';
import slashify from 'slash';
import type * as vite from 'vite';
import type { AstroSettings } from '../@types/astro';
type NodeFileSystemModule = typeof nodeFs;
@ -49,11 +48,11 @@ export default function loadFallbackPlugin({
try {
// Check to see if this file exists and is not a directory.
const stats = await fs.promises.stat(candidateId);
if(!stats.isDirectory()) {
if (!stats.isDirectory()) {
return candidateId;
}
} catch {}
}
}
let resolved = await this.resolve(id, parent, { skipSelf: true });
if (resolved) {

View file

@ -2,9 +2,7 @@ import { expect } from 'chai';
import * as cheerio from 'cheerio';
import { fileURLToPath } from 'url';
import {
runInContainer,
} from '../../../dist/core/dev/index.js';
import { runInContainer } from '../../../dist/core/dev/index.js';
import { openConfig, createSettings } from '../../../dist/core/config/index.js';
import { createFs } from '../test-utils.js';
import { defaultLogging } from '../../test-utils.js';
@ -30,12 +28,15 @@ describe('Astro config formats', () => {
flags: {},
cmd: 'dev',
logging: defaultLogging,
fsMod: fs
fsMod: fs,
});
const settings = createSettings(astroConfig);
await runInContainer({ fs, root, settings }, () => {
expect(true).to.equal(true, 'We were able to get into the container which means the config loaded.');
expect(true).to.equal(
true,
'We were able to get into the container which means the config loaded.'
);
});
});
});