0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-04-07 23:41:43 -05:00

[ci] format

This commit is contained in:
natemoo-re 2023-10-24 18:50:46 +00:00 committed by astrobot-houston
parent b236d88add
commit 63f7242aba
2 changed files with 16 additions and 17 deletions

View file

@ -85,7 +85,7 @@ describe('typescript', () => {
describe('typescript: setup tsconfig', () => {
beforeEach(() => resetFixtures());
it('none', async () => {
const root = new URL('./fixtures/empty/', import.meta.url);
const tsconfig = new URL('./tsconfig.json', root);
@ -126,11 +126,11 @@ describe('typescript: setup package', () => {
);
await setupTypeScript('strictest', { cwd: fileURLToPath(root), install: false });
const { scripts } = JSON.parse(fs.readFileSync(packageJson, { encoding: 'utf-8' }));
expect(Object.keys(scripts)).to.deep.eq(['dev', 'build', 'preview'], 'does not override existing scripts');
expect(scripts.build).to.eq(
'astro check && astro build',
'prepends astro check command'
expect(Object.keys(scripts)).to.deep.eq(
['dev', 'build', 'preview'],
'does not override existing scripts'
);
expect(scripts.build).to.eq('astro check && astro build', 'prepends astro check command');
});
});

View file

@ -38,17 +38,16 @@ const resetNotEmptyFixture = async () => {
const packagePath = new URL('./fixtures/not-empty/package.json', import.meta.url);
const tsconfigPath = new URL('./fixtures/not-empty/tsconfig.json', import.meta.url);
const packageJsonData = JSON.parse(await fs.promises.readFile(packagePath, { encoding: 'utf-8' }));
const overriddenPackageJson = Object.assign(
packageJsonData,
{
scripts: {
dev: 'astro dev',
build: 'astro build',
preview: 'astro preview'
}
}
)
const packageJsonData = JSON.parse(
await fs.promises.readFile(packagePath, { encoding: 'utf-8' })
);
const overriddenPackageJson = Object.assign(packageJsonData, {
scripts: {
dev: 'astro dev',
build: 'astro build',
preview: 'astro preview',
},
});
return Promise.all([
fs.promises.writeFile(packagePath, JSON.stringify(overriddenPackageJson, null, 2), {