[ci] format

This commit is contained in:
matthewp 2022-09-22 20:39:53 +00:00 committed by fredkbot
parent 4b092269c1
commit a5df3f313e
2 changed files with 8 additions and 10 deletions

View file

@ -174,10 +174,12 @@ class AstroBuilder {
private validateConfig() { private validateConfig() {
const { config } = this.settings; const { config } = this.settings;
// outDir gets blown away so it can't be the root. // outDir gets blown away so it can't be the root.
if(config.outDir.toString() === config.root.toString()) { if (config.outDir.toString() === config.root.toString()) {
throw new Error(`the outDir cannot be the root folder. Please build to a folder such as dist.`); throw new Error(
`the outDir cannot be the root folder. Please build to a folder such as dist.`
);
} }
} }

View file

@ -13,7 +13,7 @@ describe('outDir set to project root', async () => {
fixture = await loadFixture({ root: './fixtures/dont-delete-me/' }); fixture = await loadFixture({ root: './fixtures/dont-delete-me/' });
try { try {
await fixture.build(); await fixture.build();
} catch(err) { } catch (err) {
error = err; error = err;
} }
}); });
@ -24,13 +24,9 @@ describe('outDir set to project root', async () => {
}); });
it('Files have not been deleted', async () => { it('Files have not been deleted', async () => {
const expectedFiles = [ const expectedFiles = ['package.json', 'astro.config.mjs', 'src/pages/index.astro'];
'package.json',
'astro.config.mjs',
'src/pages/index.astro'
];
for(const rel of expectedFiles) { for (const rel of expectedFiles) {
const root = new URL('./fixtures/dont-delete-me/', import.meta.url); const root = new URL('./fixtures/dont-delete-me/', import.meta.url);
const url = new URL('./' + rel, root); const url = new URL('./' + rel, root);
const stats = await fs.promises.stat(url); const stats = await fs.promises.stat(url);