summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/core/config.ts10
-rw-r--r--packages/astro/test/config.test.js10
-rw-r--r--packages/astro/test/test-utils.js6
3 files changed, 16 insertions, 10 deletions
diff --git a/packages/astro/src/core/config.ts b/packages/astro/src/core/config.ts
index 5231f5ffa..a3350f134 100644
--- a/packages/astro/src/core/config.ts
+++ b/packages/astro/src/core/config.ts
@@ -379,14 +379,20 @@ export async function loadConfig(configOptions: LoadConfigOptions): Promise<Astr
if (flags?.config) {
userConfigPath = /^\.*\//.test(flags.config) ? flags.config : `./${flags.config}`;
- userConfigPath = fileURLToPath(new URL(userConfigPath, appendForwardSlash(pathToFileURL(root).toString())));
+ userConfigPath = fileURLToPath(
+ new URL(userConfigPath, appendForwardSlash(pathToFileURL(root).toString()))
+ );
}
// Automatically load config file using Proload
// If `userConfigPath` is `undefined`, Proload will search for `astro.config.[cm]?[jt]s`
let config;
try {
- config = await load('astro', { mustExist: !!userConfigPath, cwd: root, filePath: userConfigPath });
+ config = await load('astro', {
+ mustExist: !!userConfigPath,
+ cwd: root,
+ filePath: userConfigPath,
+ });
} catch (err) {
if (err instanceof ProloadError && flags.config) {
throw new Error(`Unable to resolve --config "${flags.config}"! Does the file exist?`);
diff --git a/packages/astro/test/config.test.js b/packages/astro/test/config.test.js
index fe25e2f9e..bd03b89bc 100644
--- a/packages/astro/test/config.test.js
+++ b/packages/astro/test/config.test.js
@@ -78,7 +78,7 @@ describe('config', () => {
const localURL = new URL(local);
expect(localURL.port).to.equal('8080');
});
- })
+ });
describe('relative path with leading ./', () => {
it('can be passed via relative --config', async () => {
@@ -94,7 +94,7 @@ describe('config', () => {
const localURL = new URL(local);
expect(localURL.port).to.equal('8080');
});
- })
+ });
describe('incorrect path', () => {
it('fails and exits when config does not exist', async () => {
@@ -113,10 +113,10 @@ describe('config', () => {
exit = 1;
}
}
-
- expect(exit).to.equal(1, "Throws helpful error message when --config does not exist");
+
+ expect(exit).to.equal(1, 'Throws helpful error message when --config does not exist');
});
- })
+ });
describe('port', () => {
it('can be specified in astro.config.mjs', async () => {
diff --git a/packages/astro/test/test-utils.js b/packages/astro/test/test-utils.js
index b850486c3..aabb24ce5 100644
--- a/packages/astro/test/test-utils.js
+++ b/packages/astro/test/test-utils.js
@@ -171,7 +171,7 @@ export async function parseCliDevStart(proc) {
if (stderr) {
throw new Error(stderr);
}
-
+
const messages = stdout
.split('\n')
.filter((ln) => !!ln.trim())
@@ -185,8 +185,8 @@ export async function cliServerLogSetup(flags = [], cmd = 'dev') {
const { messages } = await parseCliDevStart(proc);
- const local = messages.find(msg => msg.includes('Local'))?.replace(/Local\s*/g, '');
- const network = messages.find(msg => msg.includes('Network'))?.replace(/Network\s*/g, '');
+ const local = messages.find((msg) => msg.includes('Local'))?.replace(/Local\s*/g, '');
+ const network = messages.find((msg) => msg.includes('Network'))?.replace(/Network\s*/g, '');
return { local, network };
}